WinRb / winrm-elevated

Runs PowerShell commands as elevated over Windows Remote Management (WinRM) via a scheduled task
Apache License 2.0
27 stars 17 forks source link

Wrap task setup within try block and exit on caught errors #33

Closed chrisroberts closed 4 years ago

chrisroberts commented 4 years ago

If the task setup fails, catch exception and exit with exception error information to prevent script getting stuck in infinite loop.

The error state this is fixing can be seen using a Windows Server with a username lacking the domain/workspace prefix. Creating the task will fail, but the script will proceed and get stuck in the loop waiting for completion which will never occur.

mwrock commented 4 years ago

very nice. Thanks!