Skip to content

Instantly share code, notes, and snippets.

@ProTip
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ProTip/a2301025cfc4d8b9500f to your computer and use it in GitHub Desktop.
Save ProTip/a2301025cfc4d8b9500f to your computer and use it in GitHub Desktop.
powershell_script "set_interface_addr" do
cwd Chef::Config[:file_cache_path]
code <<-EOH
New-NetIPAddress –InterfaceAlias “Wired Ethernet Connection” –IPv4Address #{node[ip_address]} –PrefixLength #{node[prefix]} -DefaultGateway #{node[gateway]}
EOH
end
ps = powershell_script "set_interface_addr" do
cwd Chef::Config[:file_cache_path]
code <<-EOH
New-NetIPAddress –InterfaceAlias “Wired Ethernet Connection” –IPv4Address #{node[ip_address]} –PrefixLength #{node[prefix]} -DefaultGateway #{node[gateway]}
EOH
end
ps.run_action(:run)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment