Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Override FileSystem Provider's Treatment of Tilde

Reply
 
Old 01-12-2007   #1 (permalink)
Tom G.


 
 

Override FileSystem Provider's Treatment of Tilde

Is there some way to override how the filesystem provider treats the
tilde (~) character? I would like to change the path that ~ resolves
to. I thought that maybe it corresponded to the $home constant, but it
does not.

Tom G.

--


My System SpecsSystem Spec
Old 01-12-2007   #2 (permalink)
Marcel J. Ortiz [MSFT]


 
 

Re: Override FileSystem Provider's Treatment of Tilde

The ~ is resolved by providers to their home location. Each provider can
have its own home location which you can view like this:

PS>get-psprovider | ft Name, Home

Name Home
---- ----
Alias
Environment
FileSystem C:\Documents and
Settings\mosoto
Function
Registry
Variable
Certificate


PS>

To change the provider home location just do:

PS>$provider = get-psprovider filesystem # or another provider name
PS>$provider.Home
C:\Documents and Settings\mosoto
PS>$provider.Home = 'c:\'
PS>cd ~; get-location

Path
----
C:\


PS>




"Tom G." <thomglow@lycos.com> wrote in message
news:%23rzclJlNHHA.4916@TK2MSFTNGP06.phx.gbl...
> Is there some way to override how the filesystem provider treats the
> tilde (~) character? I would like to change the path that ~ resolves
> to. I thought that maybe it corresponded to the $home constant, but it
> does not.
>
> Tom G.
>
> --
>



My System SpecsSystem Spec
Old 01-17-2007   #3 (permalink)
Tom G.


 
 

Re: Override FileSystem Provider's Treatment of Tilde

Marcel J. Ortiz [MSFT] wrote:

> The ~ is resolved by providers to their home location. Each provider
> can have its own home location which you can view like this:
>
> PS>get-psprovider | ft Name, Home
>
> Name Home
> ---- ----
> Alias
> Environment
> FileSystem
> C:\Documents and Settings\mosoto Function
> Registry
> Variable
> Certificate
>
>
> PS>
>
> To change the provider home location just do:
>
> PS>$provider = get-psprovider filesystem # or another provider name
> PS>$provider.Home
> C:\Documents and Settings\mosoto
> PS>$provider.Home = 'c:\'
> PS>cd ~; get-location
>
> Path
> ----
> C:\
>
>
> PS>
>

That is a great explanation and works great. Thank you very much.

Tom G.




>
>
>
> "Tom G." <thomglow@lycos.com> wrote in message
> news:%23rzclJlNHHA.4916@TK2MSFTNGP06.phx.gbl...
> > Is there some way to override how the filesystem provider treats the
> > tilde (~) character? I would like to change the path that ~ resolves
> > to. I thought that maybe it corresponded to the $home constant, but
> > it does not.
> >
> > Tom G.
> >
> > --



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Tilde Key will not work on games in Vista 32bit Vista General
Tilde Key not responsiv in a few games, something to do with IR. Vista General
PM override of task status .NET General
using the tilde with n like in spanish Vista General
OVERRIDE on monitor Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46