|
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.
> >
> > -- |