I have a AWS cloudforamtion - whih build my entire VPC with subnets etc - within this CF builds a windows 2012 server - we want to bootstrap this server under user data so it become a domain controller. All our ps1 scripts are hosted on github. under user data i have entered as below
"<powershell>\n",
"Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force\n",
"Rename-Computer AWSAD10 -restart\n",
"Start-Sleep -s 100\n",
"$url = \"https://github.com/username/gittest/blob/testinggit/NewAD.ps1\" \n",
"(New-Object System.Net.WebClient).DownloadFile($url, 'C:\\Windows\\Temp\\NewAD.ps1')\n",
the commands to rename the computer works OK - here what is not working the NewAD.PS1 script which is hosted on git - when i run this script on local server all works OK so it promotes to AD by running local however the pull from git is not working - I have also tried:
$trueInvoke-WebRequest -Uri "$trueInvoke-WebRequest -Uri "https://raw.github.com/cloudbase/unattended-setup-scripts/master/UpdateAndSysprep.ps1" \n",
Any ideas please as I have one week try to figure out how i can do this? and is not much out there how to get this working