mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
8ab6603999
- Creates a new parameter [bool]InjectUnattend - This will take the FFUDevelopment\Unattend\unattend_[arch].xml file and copy it to the FFUDevelopment\Apps\Unattend and rename the file to unattend.xml. - This is useful for situations where you don't use the USB drive for deploying the FFU but still have Unattend-related customizations that you want to apply.
19 lines
1.1 KiB
PowerShell
19 lines
1.1 KiB
PowerShell
#The below lines will remove the unattend.xml that gets the machine into audit mode. If not removed, the OS will get stuck booting to audit mode each time.
|
|
#Also kills the sysprep process in order to automate sysprep generalize
|
|
|
|
Write-Host "Removing existing unattend.xml files and stopping sysprep process if running..."
|
|
Remove-Item -Path "C:\windows\panther\unattend\unattend.xml" -Force -ErrorAction SilentlyContinue
|
|
Remove-Item -Path "C:\windows\panther\unattend.xml" -Force -ErrorAction SilentlyContinue
|
|
Stop-Process -Name "sysprep" -Force -ErrorAction SilentlyContinue
|
|
Start-Sleep -Seconds 10
|
|
# If an Unattend.xml has been provided on the mounted Apps ISO (D:\Unattend\Unattend.xml),
|
|
# pass it to sysprep; otherwise, run without /unattend.
|
|
$unattendOnAppsIso = "D:\Unattend\Unattend.xml"
|
|
if (Test-Path -Path $unattendOnAppsIso) {
|
|
Write-Host "Using $unattendOnAppsIso from Apps ISO..."
|
|
& "C:\windows\system32\sysprep\sysprep.exe" /quiet /generalize /oobe /unattend:$unattendOnAppsIso
|
|
}
|
|
else {
|
|
& "C:\windows\system32\sysprep\sysprep.exe" /quiet /generalize /oobe
|
|
}
|