Skip to content

Instantly share code, notes, and snippets.

@rahulmr
Created August 4, 2017 09:57
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 rahulmr/4d3b9a056f43a7bb05e4c814c8907cdc to your computer and use it in GitHub Desktop.
Save rahulmr/4d3b9a056f43a7bb05e4c814c8907cdc to your computer and use it in GitHub Desktop.
Cloud Init MS Windows Poor Man Script Install Chocolatey and packages
#cloud-config
script: |
<powershell>
Try {
(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex
import-module PsGet
Install-Module PowerYaml
$userdata = (Get-Yaml (Invoke-RestMethod http://instance-data/latest/user-data))
}
Catch
{
Set-Content C:/setup-error.txt -Value $_.Exception.Message
throw
}
} *> c:/setup.log
</powershell>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment