Search notes:

PowerShell: The automatic variable $HOME

$home is equivalent to $env:homeDrive$env:homePath and points to a user's home directory (for example C:\Users\username).
PS C:\> write-output $home`n$env:homeDrive$env:homePath
The home directory can be abbreviated with the tilde:
ls ~/*
cd ~

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 ~

See also

$pwd stores the current working directory.
Other automatic variables

Index