Blocking on completion

Oct 4, 2013 at 10:53 AM
Thanks for the great script.

I have a small issue. Seemingly randomly the the powershell windows seems to be waiting for input after 'Start-Process' has finished and the command window has closed. I'm using the following options...
    -AutoLaunchBuildLog `
    -BuildLogDirectoryPath $logPath `
    -ShowBuildWindowAndPromptForInputBeforeClosing
Has anyone seen the same behavior?
Coordinator
Oct 25, 2013 at 10:43 PM
I've tried to reproduce this problem using your same parameters, but haven't been able to. Are you able to reproduce it on any other computers? Maybe try changing the $logPath (although that shouldn't have anything to do with your problem, but it's worth a shot). Also, are you running the script from PowerShell ISE, or from a regular Windows PowerShell console?
Oct 27, 2013 at 5:25 PM
Edited Oct 27, 2013 at 5:25 PM
The problem was very intermittent on average failing 1 in 5 times. I tried executing the script from both the console and ISE with both exhibiting the same behaviour. In the end I re-wrote the 'Start-Process' section of your script with the below...
# Setup process start information.
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
    
$pinfo.FileName = 'cmd.exe'
$pinfo.RedirectStandardError = $false
$pinfo.RedirectStandardOutput = $false
$pinfo.UseShellExecute = (!$ShowBuildWindow)
$pinfo.Arguments = $cmdArgumentsToRunMsBuild
$pinfo.CreateNoWindow = $false
$pinfo.WindowStyle = $windowStyle

# Setup process information.
$p = New-Object System.Diagnostics.Process
    
$p.StartInfo = $pinfo
$p.Start()

$p.WaitForExit()
It now works reliably for me. It needs a little more work to fully support all the options offered by your original script as I've only had time to amend the parts I needed.
May 26, 2014 at 11:47 AM
I have the exact same problem with the current version. Would be nice if there is a fix for this..
Coordinator
May 25, 2016 at 8:02 AM
I still have not been able to reproduce this problem. Can you confirm if it is still an issue with the latest version of the script? Currently v2.0.0.
May 25, 2016 at 12:15 PM
I haven't been using the script for a while now (nothing to do with this issue). Sorry, I can't confirm.