Skip to content

Commit 4c315ff

Browse files
authored
Merge pull request #6051 from boumenot/patch-2
Update build-image-with-packer.md
2 parents 01cc8fa + 8606236 commit 4c315ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

articles/virtual-machines/windows/build-image-with-packer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ Create a file named *windows.json* and paste the following content. Enter your o
107107
"type": "powershell",
108108
"inline": [
109109
"Add-WindowsFeature Web-Server",
110-
"if( Test-Path $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml ){ rm $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml -Force}",
111-
"& $Env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /shutdown /quiet"
110+
"& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /quiet /quit",
111+
"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 } else { break } }"
112112
]
113113
}]
114114
}

0 commit comments

Comments
 (0)