I'm running a bunch of python scripts that are located in a couple of folders on my desktop. I hate having to type
'cd "C:/Path/to/desktop/folder"'
to go from one folder to another that contains scripts. I want to be able to switch folders easily like
'cd ..'
'folder 1'
so i can switch back to the desktop directory and the type in just the folders name. Is this possible with powershell? Do I just need to add the desktop path to the path environment, if so how do I do this in powershell
cd ~/Desktop
or cd ~\Desktop
is what you need.
First : You've got the PowerShell pending to the subst.exe cmd.exe
command line interpreter.
New-PSDrive -Name py -Root "cd C:/Path/to/desktop/folder" -PSProvider filesystem
then
cd py:
Second : as in linux you can use the location based CmdLets
push-location "C:/Path/to/desktop/folder"
get-location -stack
pop-location
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With