You certainly know the commands cd and Set-Location. It stands for change directory. I hope you also know the commands cd \ and cd .. But what about cd ~ ?
Type cd ~ to switch to your home directory.
Instead of ~ , the environmental variable USERPROFILE can be accessed.
Or use $home.
Well. Next I tried to use it for copying. Ant it works.
Copy-Item -Path C:\temp\dummyfile1.txt -Destination ~\Documents
Leave a Reply