Created
May 23, 2012 09:02
-
-
Save georgegoh/2774042 to your computer and use it in GitHub Desktop.
This file contains 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
#Retrieve a Userdata file. | |
function GetUserDataFile($DestinationPath) | |
{ | |
$WebClient = (New-Object Net.WebClient) | |
$WebClient.DownloadFile("http://169.254.169.254/latest/user-data/", $DestinationPath) | |
} | |
$workingDir = "C:\Windows\System32\GroupPolicy\Machine\Scripts\Startup" | |
#Get the userdata file into the working directory. | |
$userDataFileName = $workingDir + "\init.ps1" | |
GetUserDataFile $userDataFileName | |
cd $workingDir | |
.\init.ps1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment