Changing value of $home
$home
is read-only, its value cannot simply be changed by assigning a new value to it:
PS: C:\Users\rene> $home = 'c:\xyz'
Cannot overwrite variable HOME because it is read-only or constant.
…
It's possibly, however, to remove the variable with the -force
option in the following command…
PS: C:\Users\rene> remove-variable -force home
PS: C:\Users\rene> $home = 'c:\xyz'
Note, that the tilde still is an abbreviation for the correct home directory:
PS: C:\Users\rene> ls ~