To open PowerShell in a folder, open the folder in File Explorer, click the address bar, type pwsh (or powershell for Windows PowerShell 5.1) and press Enter. PowerShell starts with that folder as its location.
In Windows 11 you can also right-click inside the folder and choose Open in Terminal. Below I cover shortcuts, command-line options, admin windows and changing folders once PowerShell is open.
Open PowerShell from File Explorer
| Method | Steps | Opens |
|---|---|---|
| Address bar | Alt+D, type pwsh or powershell, Enter | PowerShell 7 or 5.1 in that folder |
| Right-click menu | Right-click empty space > Open in Terminal | Your default Terminal profile |
| Shift+right-click | Shift+right-click > Open PowerShell window here | Windows PowerShell 5.1 |
| PowerShell 7 menu | Right-click > Open here (PowerShell 7) | Only if chosen during PowerShell 7 setup |
None of these open an admin window. Elevated windows always need a separate step, which I cover below.
Start PowerShell in a folder from a command
PowerShell 7 has -WorkingDirectory. For Windows PowerShell 5.1, run Set-Location as the first command. Both work from Run (Win+R), a shortcut or another shell:
$seven = pwsh -NoProfile -WorkingDirectory 'C:\psfaqs\Client Projects' -Command '(Get-Location).Path'
$five = powershell.exe -NoProfile -Command "Set-Location 'C:\psfaqs\Client Projects'; (Get-Location).Path"
"pwsh started in: $seven"
"powershell.exe started in: $five"
Output:
pwsh started in: C:\psfaqs\Client Projects
powershell.exe started in: C:\psfaqs\Client Projects

Add -NoExit to keep the window open, for example pwsh -NoExit -WorkingDirectory 'C:\Projects'. Microsoft lists every switch in about_Pwsh.
Windows Terminal
wt -d "C:\Projects" opens Windows Terminal in a folder, and wt -d . uses the current one. See the Windows Terminal command-line arguments.
Open an admin PowerShell in a folder
Elevated windows often start in C:\Windows\System32, even when you ask for another folder. The reliable fix is to pass the folder to pwsh itself:
Start-Process pwsh -Verb RunAs -ArgumentList '-NoExit', '-WorkingDirectory', "`"$PWD`""
The escaped quotes keep folder names with spaces in one piece. Windows asks for approval before the window opens.
Change folders inside PowerShell
Once PowerShell is open, Set-Location (cd) moves you around. Push-Location saves your spot, and Pop-Location returns to it:
Set-Location -Path 'C:\psfaqs\Client Projects'
"Now in: $PWD"
Push-Location -Path '.\Contoso Austin'
"Pushed to: $PWD"
Pop-Location
"Popped back: $PWD"
Output:
Now in: C:\psfaqs\Client Projects
Pushed to: C:\psfaqs\Client Projects\Contoso Austin
Popped back: C:\psfaqs\Client Projects

Put quotes around paths with spaces. The Set-Location reference covers other drives, like HKCU: and Cert:.
Current folder vs. script folder
A script runs in whatever folder you’re in, not the folder it’s saved in. $PSScriptRoot gives you the script’s own folder. Here’s a small script saved as C:\psfaqs\Tools\report.ps1:
"Current folder (`$PWD): $PWD"
"Script folder (`$PSScriptRoot): $PSScriptRoot"
I run it from a different folder:
Set-Location -Path 'C:\psfaqs\Client Projects'
& 'C:\psfaqs\Tools\report.ps1'
Output:
Current folder ($PWD): C:\psfaqs\Client Projects
Script folder ($PSScriptRoot): C:\psfaqs\Tools

Build file paths from $PSScriptRoot so a script finds its own files from any folder. Running scripts from the command line covers the rest.
Open File Explorer from PowerShell
Going the other way, Invoke-Item . (or ii .) opens the current folder in File Explorer. explorer.exe . does the same.
Frequently Asked Questions
How do I open PowerShell in a specific folder?
Type pwsh or powershell in the File Explorer address bar and press Enter, or right-click and choose Open in Terminal.
Does Shift+right-click open PowerShell as administrator?
No. Open PowerShell window here opens a normal window. Use Start-Process with -Verb RunAs for an admin window.
How do I start pwsh in a folder from the command line?
Run pwsh -NoExit -WorkingDirectory 'C:\Projects'.
How do I change folders in PowerShell?
Use Set-Location 'C:\Projects', or its alias cd. Quote paths that contain spaces.
What is the difference between $PWD and $PSScriptRoot?
$PWD is your current folder. $PSScriptRoot is the folder the running script is saved in.
Next steps for working in PowerShell:
- Run a script from the command line
- Run PowerShell as a different user
- List directories and files
- Find an executable’s location
Bijay Kumar is an esteemed author and the mind behind PowerShellFAQs.com, where he shares his extensive knowledge and expertise in PowerShell, with a particular focus on SharePoint projects. Recognized for his contributions to the tech community, Bijay has been honored with the prestigious Microsoft MVP award. With over 15 years of experience in the software industry, he has a rich professional background, having worked with industry giants such as HP and TCS. His insights and guidance have made him a respected figure in the world of software development and administration. Read more.