invoke-item
performs the «default action» on the specified item. On most system, the following command opens foo.txt
in a text editor: invoke-item foo.txt
xyz.ps1
. It's possible it is opened in an editor: Invoke-item .\xyz.ps1
invoke-item
comes in handy to open a given directory in the explorer: PS C:\users\rene> ii $env:temp
PS C:\users\rene> ii .
C:\users\rene> start .
InvokeItem()
in System.Management.Automation.Provider.ItemCmdletProvider
. -credential
.