Commit Graph

4 Commits

Author SHA1 Message Date
Shawn Neal 291f01045b Fixed issue 3918
Running Windows guest commands through a scheduled task were not returning the correct exit codes, they were only returning 1 or 0. This has negative consequences especially for Puppet which can return an exit code of 2 for partial success.

Since we're running an executable from inside a powershell encoded command we need to ensure we explicitly propagate the exit code to the original caller just like a regular PowerShell script - in this case cmd /c which in return is called from a scheduled task.
2014-05-28 08:54:36 -07:00
Shawn Neal 823e80fa32 Fixed issue 3729
The logic used to read the file contents sometimes would leave lines behind unread. It now defaults to reading all lines and counts each line it has actually read.
2014-05-15 09:17:57 -07:00
Shawn Neal 1dd081d866 Don't use interpolated strings for username and password
Its possible that usernames and passwords may contain special characters like $
2014-04-26 21:07:26 -07:00
Shawn Neal 045e06455a Added WinRM elevated shell wrapper script
This script creates an immediately run scheduled task using fresh credentials. This is a generic implementation used by the Chef provisioners. The script gets around several limitations in WinRM.

1. Credential hopping
2. The non-default Administrator account sometimes doesn't have true Administrator access when run through WinRM even with UAC disabled.

In short, this script allows commands to run through WinRM just as if they were run directly on the box.
2014-04-26 21:07:26 -07:00