Guest User

Untitled

a guest
Dec 14th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. /******************************************************************************
  2. Situation...
  3.  
  4. There is a DOS batch script named foo.bat in C:\temp\foo.bat. We want
  5. ******************************************************************************/
  6.  
  7. $things-todo-when-batchfile-completes = {
  8. new-item 'c:\temp\thinger-done.txt'
  9. Get-EventSubscriber | Unregister-Event
  10. }
  11.  
  12. $file_run = Start-Process -FilePath ".\thing.bat" -PassThru
  13.  
  14. $job = register-objectevent -InputObject $file_run `
  15. -eventname exited `
  16. -SourceIdentifier test `
  17. -Action $event_response
Add Comment
Please, Sign In to add comment