Last active
March 18, 2017 21:47
-
-
Save babakc/88e15cc00bbb817f6ae10c4a7c0e49f7 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
# Finally, perform sysprep. | |
# Start sysprep but quit instead of shutdown | |
Start-Process -FilePath $sysprepPath -ArgumentList ("/oobe /quit /generalize `"/unattend:{0}`"" -f $answerFilePath) -Wait -NoNewWindow | |
# Replace windeploy.exe with the custom PowerShell startup script | |
Set-ItemProperty -Path HKLM:\System\setup -Name CmdLine -Value "powershell.exe -command c:\Scripts\startup.ps1" | |
# Delete the existing route to query instance metadata | |
route delete 169.254.169.254 | |
# Shutdown the host | |
Stop-Computer -Force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment