Open a Folder Using PowerShell
Invoke-ItemCmdlet to Open a Folder Using PowerShell
startto Open a Folder Using PowerShell
explorerto Open a Folder Using PowerShell
Sometimes when working on PowerShell, you might need to open folders or files, and you exit the PowerShell window to open folders. You can easily navigate different folders and open them without leaving the PowerShell window.
This tutorial will teach you to open a folder or file using PowerShell.
Invoke-Item Cmdlet to Open a Folder Using PowerShell
Invoke-Item command performs the default action on the specified item. For example, it opens an executable file in the application of its file type.
When a folder path is given, it opens that folder in the new File Explorer window.
If you provide
. as an argument will open the current working directory in File Explorer.
Similarly, you have to specify a file path to open a file. The following command opens a
text.txt file in the
If you find
Invoke-Item long, you can also use its alias
ii to open folders or files from PowerShell.
start to Open a Folder Using PowerShell
start is an alias for the
Start-Process cmdlet. It starts one or more processes on the local computer.
You have to specify an executable file or a file that a program can open on the computer. The following command opens a
C:\Personal Website folder on the computer.
start 'C:\Personal Website'
To open a current working directory, you can use
explorer to Open a Folder Using PowerShell
Another way to open a folder from PowerShell is using
explorer.exe in the console. It simply opens the specified folder or file in the Windows File Explorer.
You can also use
. to open the current folder in the File Explorer.
We hope this article helps you understand how to open a folder or file from Windows PowerShell.
Related Article - PowerShell Folder
- Get the Size of the Folder Including the Subfolders in PowerShell
- PowerShell Compare Folders
- Set Folder Permissions in PowerShell
- Delete Empty Folders in PowerShell
- Recursively Set Permissions on Folders Using PowerShell