Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(puppetlabsGH-1846) Wrap all powershell commands in a script
Powershell will [exit 1](PowerShell/PowerShell#11461) whenever the $LASTEXITCODE is greater than 0, regardless of what the code is, whenever running a bare command. Powershell exits with the correct exit code when executing files, or when `exit $LASTEXITCODE` is appended to the command being run (as in the [execute_process snippet](https://github.com/puppetlabs/bolt/blob/0d44ce739d4dafcb6d27abd894e230894fdd50e0/lib/bolt/shell/powershell/snippets.rb#L19), meaning this is only an issue when running commands using the local transport through Bolt. This appends a Powershell snippet to exit with the correct exit code to commands running on Windows using the local transport. Closes puppetlabs#1846 !bug * **Return correct exit code when running commands in powershell** ([1846](puppetlabs#1846)) Bolt will now display the correct exit code when running commands in powershell that exit with code > 1.
- Loading branch information