Menu & Search

Open Current Folder in PowerShell

Open Current Folder in PowerShell

When you are working within a PowerShell terminal session, you may want to open Windows Explorer for the current directory you are set as in your terminal. This guide will show you how to open the current working directory from PowerShell.

Invoke-Item is the cmdlet to do this, and we add a ‘.’ to indicate we want the current working PowerShell directory.

# Open current folder in windows explorer
Invoke-Item .
Invoke-Item PowerShell

Invoke-Item can also be called with just ‘ii’, and you can specify a file and file path. We’re running a .ps1 script here, writing to output and opening the current directory. Windows Explorer will open when you run this.

## ps script to open the current folder
write-output 'Opening current folder...' 
ii .
Run power shell script

That’s about it for this one. Have a look at my PowerShell Tips tag for more random PowerShell Tips!

0 Comments