Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Import-Module C:\Users\erik\Documents\WASP\WASP.dll
- try
- {
- $timeout = new-timespan -Seconds 5
- $sw = [diagnostics.stopwatch]::StartNew()
- # Wait until the program is started
- while ((Select-Window -ProcessName NOTEPAD) -eq $null)
- {
- Write-Progress "Waiting for NOTEPAD"
- if ($sw.elapsed -gt $timeout)
- {
- throw "time out"
- }
- }
- Write-Host "Notepad detected"
- }
- catch
- {
- Write-Host "ERROR: $($Error[0].Exception)"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement