Unlike the CMD.EXE CHDIR or CD command, the PowerShell Set-Location cmdlet will change the drive and directory, both. Get-Help Set-Location -Full will give you more details about Set-Location , but the main use will be
PS C:\> Set-Location -Path Q:\MyDir PS Q:\MyDir>
By default, PowerShell CD and CHDIR are aliases for Set-Location .
( Assad reminded me in the comments that if the path contains spaces, it must be enclosed in quotation marks.)
Jeff zeitlin
source share