Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exec { schtasks /foo } #Let's send a bogus argument to the task scheduler executable
- write-host "This should not be output!"
- Output:
- ERROR: Invalid argument/option - '/foo'.
- Type "SCHTASKS / QUERY /?" for usage.
- Error executing command: schtasks /foo
- At C:\dev\blog_post\default.ps1:11 char:8
- + throw <<<< $errorMessage
- + CategoryInfo : OperationStopped: (Error executing command: sch
- tasks /foo :String) [], RuntimeException
- + FullyQualifiedErrorId : Error executing command: schtasks /foo
Add Comment
Please, Sign In to add comment