Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- echo "Callee is executing ..."
- exit /B 0
- $scriptBlock = {
- $res = Start-Process -FilePath "cmd.exe" -Wait -PassThru -NoNewWindow -ArgumentList "/c .callee.cmd"
- throw "ERROR!"
- }
- $job = Start-Job -ScriptBlock $scriptBlock
- Wait-Job $job
- Receive-Job $job
- Write-Host($job.State)
- Id Name PSJobTypeName State HasMoreData Location Command
- -- ---- ------------- ----- ----------- -------- -------
- 1 Job1 BackgroundJob Completed True localhost ...
- Completed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement