Skip to content

Instantly share code, notes, and snippets.

@stathy
Last active August 29, 2015 14:17
Show Gist options
  • Save stathy/1b03a217f0002ef2c29f to your computer and use it in GitHub Desktop.
Save stathy/1b03a217f0002ef2c29f to your computer and use it in GitHub Desktop.
Example representation of Chef resource converted from powershell_script resource.
powershell_script "Set ExecutionPolicy to Unrestricted" do
code %q(Set-ExecutionPolicy Unrestricted -force)
end
## CONVERT TO
powershell_execution_policy
restricted false
end
powershell_script "Set ExecutionPolicy to Restricted" do
code "Set-ExecutionPolicy Restricted -force"
end
### Convert to
powershell_execution_policy
restricted true
end
@stathy
Copy link
Author

stathy commented Mar 26, 2015

Set execution policy

Explicit powershell

powershell_script "Set ExecutionPolicy to Unrestricted" do
  code %q(Set-ExecutionPolicy Unrestricted -force)
end

CONVERT TO

Implicit powershell as Chef resource

powershell_execution_policy
  restricted false
end

Explicit powershell

powershell_script "Set ExecutionPolicy to Restricted" do
code "Set-ExecutionPolicy Restricted -force"
end

CONVERT TO

Implicit powershell as Chef resource

powershell_execution_policy
  restricted true
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment