Last active
August 29, 2015 14:12
-
-
Save totomz/4d033fa1b991504a4e31 to your computer and use it in GitHub Desktop.
[GCE] Download and execute a powershell startup script from Google Cloud Storage in Google Cloud Engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $gscript = "test-script/startup.ps1";Invoke-Expression $(Invoke-RestMethod -Uri $("https://storage-download.googleapis.com/"+$gscript+"?access_token=" + $($(Invoke-RestMethod -Uri "http://metadata/computeMetadata/v1/instance/service-accounts/default/token" -Headers @{"Metadata-Flavor"="Google"}).access_token))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Upload your .ps1 script, and add this gist as windows-startup-script-ps1 metadata. Edit $gcsript with /<script>