How do I get PowerShell to wait until the Invoke-Item call has finished? I'm invoking a non-executable item, so I need to use Invoke-Item to open it.
相关问题
- How to Debug/Register a Permanent WMI Event Which
- C# how to invoke a field initializer using reflect
- How can I do variable substitution in a here-strin
- How to use a default value with parameter sets in
- Does powershell have a method_missing()?
相关文章
- 在vscode如何用code runner打开独立的控制台窗口,以及设置好调试模式时窗口的编码?
- C#调用PowerShell的问题
- EscapeDataString having differing behaviour betwee
- PowerShell Change owner of files and folders
- Command line escaping single quote for PowerShell
- Is there a simple way to pass specific *named* Pow
- How do I access an element with xpath with a names
- How to 'Grant Permissions' Using Azure Act
Pipe your command to Out-Null.
Unfortunately you can't by using the
Invoke-Item
Commandlet directly. This command let has a void return type and no options that allow for a wait.The best option available is to define your own function which wraps the
Process
API like soJust use
Start-Process -wait
, for exampleStart-Process -wait c:\image.jpg
. That should work in the same way as the one by @JaredPar.One easy way