

its ThreadState property will be Wait), waiting for user input (i.e., its WaitReason property will be LpcReply).Powershell $Count = 1 Do Until ( $Key. If a process is waiting for input, one of its threads will be in a wait state (i.e. NET class has a Threads property, which is a collection of ProcessThread objects. Google turned up Is My Process Waiting for Input? on StackOverflow. There is, of course, one teeny tiny problem with the script as written. PauseScriptReadName.ps1 a read-host what is your name hello a When the PauseScriptReadName.ps1 script runs in the Windows PowerShell ISE, a pop-up window appears, as shown in the following image. So, my script needs to detect when Mercurial is prompting for input, kill it, then notify those responsible that manual intervention is necessary. One such example is pausing a script to wait for user input. Prompting for input won’t work under a continuous integration server because no one’s around to answer.

if a file was deleted by someone, but modified by someone else, Mercurial asks if you want to keep the change or keep the deletion). Because it will run under our continuous integration build server, it needs to be able to run headless (i.e., non-interactively).ĭuring a merge, Mercurial will sometimes prompt the user for input (e.g.

Rinse and repeat until the push succeeds. If there are new changes on the server, the script will need to pull those changes down before it pushes, merge them, commit the merge, then re-push to the server. I’m currently writing a PowerShell script that will commit changes to a Mercurial repository, then push those changes out to our central Mercurial server.
