Skip to content

Instantly share code, notes, and snippets.

@dylanmei
Created March 15, 2015 22:39
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 dylanmei/3316360a4e550c8e2ab7 to your computer and use it in GitHub Desktop.
Save dylanmei/3316360a4e550c8e2ab7 to your computer and use it in GitHub Desktop.
packer / winrm / powershell elevated command
{
"builders": [{
"type": "virtualbox-windows-ovf",
"source_path": "ovf/windows_2008_r2.bare.ova",
"headless": false,
"boot_wait": "1m",
"winrm_username": "packer",
"winrm_password": "packer",
"winrm_wait_timeout": "10m",
"guest_additions_mode": "disable",
"shutdown_timeout": "2h",
"shutdown_command": "shutdown /s /t 7200 /f /d p:4:1 /c \"Packer Shutdown\"",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "2048"],
["modifyvm", "{{.Name}}", "--cpus", "1"]
]
}],
"provisioners": [{
"type": "powershell",
"scripts": ["scripts/chocolatey.ps1"]
}, {
"type": "powershell",
"elevated_user": "packer",
"elevated_password": "packer",
"inline": [
"choco install netfx-4.5.2-devpack"
]}
],
"post-processors": [{
"type": "vagrant",
"keep_input_artifact": false,
"output": "windows_2008_r2_{{.Provider}}.box",
"vagrantfile_template": "windows_2008_r2/Vagrantfile.template"
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment