Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. @echo off
  2. echo "Callee is executing ..."
  3. exit /B 0
  4.  
  5. $scriptBlock = {
  6. $res = Start-Process -FilePath "cmd.exe" -Wait -PassThru -NoNewWindow -ArgumentList "/c .callee.cmd"
  7. throw "ERROR!"
  8. }
  9.  
  10. $job = Start-Job -ScriptBlock $scriptBlock
  11. Wait-Job $job
  12. Receive-Job $job
  13. Write-Host($job.State)
  14.  
  15. Id Name PSJobTypeName State HasMoreData Location Command
  16. -- ---- ------------- ----- ----------- -------- -------
  17. 1 Job1 BackgroundJob Completed True localhost ...
  18. Completed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement