Commit Graph

6 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
Shawn Neal f44c795eed Integrated WinRM command filter into communicator
*nix commands are now filtered out instead of being sent to the guest. This means the command_alias PowerShell script is no longer needed.

Moved the PowerShell exit code helper to the WinRM shell and changed it to always return an exit code.
2014-04-23 20:38:16 -07:00
Mitchell Hashimoto bb9f0aef32 communicators/winrm: autodetect port based on forwarded ports 2014-04-21 13:51:03 -07:00