PowerShell ignores "-wait" request on Start-Process when PS is run as a win32 job - by LanDen Labs

Status : 


Sign in
to vote
ID 776078 Comments
Status Active Workarounds
Type Bug Repros 2
Opened 1/8/2013 2:21:17 PM
Access Restriction Public


If you run PowerShell from a cmd.exe window created by Powershell, the 2nd instance no longer waits for jobs to complete.  The 2nd instance is a child of a win32 job as reported by Process Explorer. 

I discovered this when my C# Explorer program is used to open a cmd.exe window and PS is run from that window, it also ignores the -Wait request. It appears that any PowerShell which is run from a cmd.exe which is a  'win32 job' fails to honor the wait request.

I ran into this with PowerShell version 3.0 on windows 7/x64
Sign in to post a comment.
Posted by Dave E 968 on 7/15/2013 at 3:38 AM
This may be related to http://connect.microsoft.com/PowerShell/feedback/details/774903/powershell-3-0-start-process-disregards-wait-parameter-when-invoked-remotely ?
Posted by Dave E 968 on 7/15/2013 at 3:28 AM
I am experiencing a similar issue.

If I run:
Start-Process -Wait notepad.exe

a) From a standard PowerShell (3.0) instance, then it waits as expected.
b) From a PowerShell (3.0) instance where I have started it with the 'run as different user' feature, then it no longer waits.

I am running this on Windows Server 2008 R2