• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

make the script wait for the execution of a program

M

Marco Shaw [MVP]

#2
I think you can sometimes try piping to out-null to cause PowerShell to wait
for completion.

Give that a try...

"PedroCesar" <tecdom@newsgroup> wrote in message
news:7d4f98e8-0530-425d-8c46-55c9597b939a@newsgroup

> How do I make the script wait for the execution of a program run
> through the start-process?
>
> Thanks
 

My Computer

P

PaulChavez

#3
Start-Process has a -wait parameter that does exactly that, at least in V2.

"PedroCesar" wrote:

> How do I make the script wait for the execution of a program run
> through the start-process?
>
> Thanks
> .
>
 

My Computer

#4
On 18 Dez., 03:14, PedroCesar <tec...@newsgroup> wrote:

> How do I make the script wait for the execution of a program run
> through the start-process?
>
> Thanks
In PS 1.0 i used this:

($proc = [system.Diagnostics.Process]::Start
("notepad.exe")).WaitForExit()
 

My Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)