mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Update BuildFFUVM.ps1
- Fix accidental variable accumulation in InstallAppsandSysprep.cmd
This commit is contained in:
@@ -4030,18 +4030,16 @@ if ($InstallApps) {
|
|||||||
WriteLog "Update complete"
|
WriteLog "Update complete"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not $AppsScriptVariables) {
|
#Modify InstallAppsandSysprep.cmd to remove old script variables
|
||||||
#Modify InstallAppsandSysprep.cmd to remove the script variables
|
$CmdContent = Get-Content -Path "$AppsPath\InstallAppsandSysprep.cmd"
|
||||||
$CmdContent = Get-Content -Path "$AppsPath\InstallAppsandSysprep.cmd"
|
$StartIndex = $CmdContent.IndexOf("REM START Batch variables placeholder")
|
||||||
$StartIndex = $CmdContent.IndexOf("REM START Batch variables placeholder")
|
$EndIndex = $CmdContent.IndexOf("REM END Batch variables placeholder")
|
||||||
$EndIndex = $CmdContent.IndexOf("REM END Batch variables placeholder")
|
if (($StartIndex + 1) -lt $EndIndex) {
|
||||||
if (($StartIndex + 1) -lt $EndIndex) {
|
for ($i = ($StartIndex + 1); $i -lt $EndIndex; $i++) {
|
||||||
for ($i = ($StartIndex + 1); $i -lt $EndIndex; $i++) {
|
$CmdContent[$i] = $null
|
||||||
$CmdContent[$i] = $null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Set-Content -Path "$AppsPath\InstallAppsandSysprep.cmd" -Value $CmdContent
|
|
||||||
}
|
}
|
||||||
|
Set-Content -Path "$AppsPath\InstallAppsandSysprep.cmd" -Value $CmdContent
|
||||||
|
|
||||||
if ($AppsScriptVariables) {
|
if ($AppsScriptVariables) {
|
||||||
#Modify InstallAppsandSysprep.cmd to add the script variables
|
#Modify InstallAppsandSysprep.cmd to add the script variables
|
||||||
|
|||||||
Reference in New Issue
Block a user