如何在Powershell中打开文件夹

bil*_*ill 42 powershell

如何在PowerShell中打开文件夹?我不是在谈论如何在特定文件夹中启动PowerShell.

我的意思是在powershell的命令行中我想打开一个文件夹,例如:"打开文档"

Sha*_*evy 66

使用Invoke-Itemcmdlet或其别名:ii.

PS> ii c:\windows # open the windows directory in windows explorer
PS> ii c:\book.xls # open book.xls in Excel
PS> ii . # open the current directory in windows explorer
Run Code Online (Sandbox Code Playgroud)


man*_*lds 14

对于Powershell和cmd兼容的方式(我认为最常见的方式):

start .
start c:\
Run Code Online (Sandbox Code Playgroud)

  • 不知道这是否应该是最常见的 - invoke-item / ii 更强大:) (2认同)

ste*_*tej 9

使用Invoke-Item,别名ii:

ii d:\temp\
Run Code Online (Sandbox Code Playgroud)


小智 7

要在powershell类型中打开当前文件夹:

PS >> explorer.exe $(pwd)


obe*_*eak 5

您可以使用explorer.exe打开该文件夹:

explorer.exe c:\temp\
explorer.exe <YourFolderPathHere>
Run Code Online (Sandbox Code Playgroud)