Powershell and $HOME variable: broken if you move your default data folders to another drive?
Solution 1:
Use the $PROFILE
variable that's described in the next section of the linked page.
PS> notepad $profile
(While it is a custom type with several properties, it can also be used on its own, as its .ToString() directly returns the current user's profile path.)
Solution 2:
You may find the Documents folder in PowerShell by the following:
[Environment]::GetFolderPath('MyDocuments')
This will work better for the case where Documents was redirected.