Skip to content

Commit f935b2b

Browse files
committed
2 parents be7f84a + e18e6a3 commit f935b2b

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Autounattend.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,19 @@
166166
</component>
167167
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
168168
<RunSynchronous>
169-
<!-- Download and install Cloudbase-Init -->
169+
<!-- Download Cloudbase-Init -->
170170
<RunSynchronousCommand wcm:action="add">
171171
<Order>1</Order>
172172
<Path>powershell -NoLogo -Command "Invoke-WebRequest -Uri http://www.cloudbase.it/downloads/CloudbaseInitSetup_Beta.msi -OutFile C:\Windows\Temp\CloudbaseInitSetup_Beta.msi"</Path>
173173
<Description>Download Cloudbase-Init Setup</Description>
174174
</RunSynchronousCommand>
175+
<!--
175176
<RunSynchronousCommand wcm:action="add">
176177
<Order>2</Order>
177178
<Path>msiexec /i C:\Windows\Temp\CloudbaseInitSetup.msi /qn /l*v C:\Windows\Temp\CloudbaseInitSetup_Beta.log</Path>
178179
<Description>Execute tools deployment script</Description>
179180
</RunSynchronousCommand>
181+
-->
180182

181183
<!-- Download and install various utilities -->
182184
<RunSynchronousCommand wcm:action="add">

UpdateAndSysprep.ps1

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Param(
2+
[switch]$InstallCloudbaseInit
3+
)
14
$ErrorActionPreference = "Stop"
25

36
Get-WUInstall -AcceptAll -IgnoreReboot
@@ -9,5 +12,21 @@ else
912
{
1013
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name Unattend*
1114
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoLogonCount
12-
C:\Windows\System32\Sysprep\Sysprep.exe /generalize /oobe /shutdown /unattend:C:\Windows\Temp\Unattend.xml
15+
if($InstallCloudbaseInit)
16+
{
17+
Invoke-WebRequest -Uri http://www.cloudbase.it/downloads/CloudbaseInitSetup_Beta.msi -OutFile C:\Windows\Temp\CloudbaseInitSetup_Beta.msi
18+
Write-Host "Sleep 60 seconds"
19+
Start-Sleep -s 60
20+
Write-Host "Install Cloudbase-Init"
21+
Start-Process -FilePath msiexec -ArgumentList "/i C:\Windows\Temp\CloudbaseInitSetup.msi /qn /l*v C:\Windows\Temp\CloudbaseInitSetup_Beta.log" -Wait
22+
Write-Host "Sleep 60 seconds take 2"
23+
Start-Sleep -s 60
24+
Write-Host "Install Cloudbase-Init take 2"
25+
Start-Process -FilePath msiexec -ArgumentList "/i C:\Windows\Temp\CloudbaseInitSetup.msi /qn /l*v C:\Windows\Temp\CloudbaseInitSetup_Beta2.log" -Wait
26+
C:\Windows\System32\Sysprep\Sysprep.exe /generalize /oobe /shutdown /unattend:C:\Program\ Files\ (x86)\Cloudbase\ Solutions\Cloudbase-Init\conf\Unattend.xml
27+
}
28+
else
29+
{
30+
C:\Windows\System32\Sysprep\Sysprep.exe /generalize /oobe /shutdown /unattend:C:\Windows\Temp\Unattend.xml
31+
}
1332
}

0 commit comments

Comments
 (0)