chef
https://github.com/opscode/chef
Ruby
A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.
Chef::Provider::PowershellScript#wrapper_script
A wrapper script is used to launch user-supplied script while still obtaining useful process exit codes. Unless you explicitly call exit in Powershell, the powershell.exe interpreter returns only 0 for success or 1 for failure. Since we'd like to get specific exit codes from executable tools run with Powershell, we do some work using the automatic variables $? and $LASTEXITCODE to return the process exit code of the last process run in the script if it is the last command executed, otherwise 0 or 1 based on whether $? is set to true (success, where we return 0) or false (where we return 1).
Edit
git clone [email protected]:opscode/chef.git
cd chef
open lib/chef/provider/powershell_script.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Chef--Provider--PowershellScript-wrapper_script-for-pr
# Commit to gitgit add lib/chef/provider/powershell_script.rbgit commit -m "better docs for Chef::Provider::PowershellScript#wrapper_script"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Chef--Provider--PowershellScript-wrapper_script-for-pr
hub pull-request
# Celebrate!