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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unfortunately you can’t by using the
Invoke-ItemCommandlet 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
ProcessAPI like so