Skip to content

Instantly share code, notes, and snippets.

View mbrouwer's full-sized avatar

Marco Brouwer mbrouwer

  • Rotterdam, The Netherlands
View GitHub Profile
@mbrouwer
mbrouwer / packer.log
Created July 11, 2018 12:32
Packer Debug Log
2018/07/11 11:18:16 [INFO] Packer version: 1.2.4
2018/07/11 11:18:16 Packer Target OS/Arch: windows amd64
2018/07/11 11:18:16 Built with Go Version: go1.10.1
2018/07/11 11:18:16 Using internal plugin for file
2018/07/11 11:18:16 Using internal plugin for ncloud
2018/07/11 11:18:16 Using internal plugin for null
2018/07/11 11:18:16 Using internal plugin for oracle-oci
2018/07/11 11:18:16 Using internal plugin for parallels-pvm
2018/07/11 11:18:16 Using internal plugin for virtualbox-iso
2018/07/11 11:18:16 Using internal plugin for azure-arm
@mbrouwer
mbrouwer / sysprep.ps1
Created July 11, 2018 07:51
Sysprep Script
write-host "Remove unattended.xml"
if ( Test-Path $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml ) { rm $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml -Force}
& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /quiet /quit
write-host "SysPrep image"
while ($true) {
$imageState = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\State | Select ImageState
if ($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') {
Write-Output $imageState.ImageState
Start-Sleep -s 10
@mbrouwer
mbrouwer / windows.json
Last active July 11, 2018 07:50
PackerJSON
{
"variables": {
"clientID": "",
"tenantID": "{{env `tenantID`}}",
"subscriptionID": "{{env `subscriptionID`}}",
"objectID": "",
"rgn": "{{env `resourceGroup`}}",
"imageSKU": "{{env `imageSKU`}}",
"packerName": "{{env `packerName`}}",
"packerPassword": "",