How to get PowerShell to wait for Invoke-Item completion?

arathorn picture arathorn · Apr 23, 2010 · Viewed 34.9k times · Source

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.

Answer

stej picture stej · Apr 23, 2010

Just use Start-Process -wait, for example Start-Process -wait c:\image.jpg. That should work in the same way as the one by @JaredPar.