I guess everyone knows that you can find current logged-in user’s profile path using variable $env:USERPROFILE, which is one of the built in environmental variables in PowerShell. However, you can also choose to navigate to current user’s profile path using ‘~’ (without single quotes). So for an example would be:
PS data [07/11/2017 09:58:00]> pwd Path ---- C:\data PS data [07/11/2017 09:58:01]> cd ~ PS mogoyal[07/11/2017 09:58:05]> pwd Path ---- C:\Users\mogoyal
However, unlike $env:userprofile, you can not use this in write-host to print out the value of the path.