Skip to content

Instantly share code, notes, and snippets.

@DBremen
Created September 2, 2015 12:45
Show Gist options
  • Save DBremen/54403d02c24e303cb5f1 to your computer and use it in GitHub Desktop.
Save DBremen/54403d02c24e303cb5f1 to your computer and use it in GitHub Desktop.
Example on how to wait for a window to appear for an executable initiated from PowerShell
$regeditInstance = [Diagnostics.Process]::Start("regedit","-m")
#wait the regedit window to appear
while ($regeditInstance.MainWindowHandle -eq 0){
sleep -Milliseconds 100
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment