Updates package addition to use native cmdlet

Replaces the direct invocation of DISM via cmd with the native Windows PowerShell cmdlet to streamline and simplify the package installation process during WinPE media creation.
This commit is contained in:
rbalsleyMSFT
2026-04-14 18:18:53 -07:00
parent 28297f3a0e
commit 0607cf5386
+1 -2
View File
@@ -3708,8 +3708,7 @@ function New-PEMedia {
foreach ($Package in $Packages) {
$PackagePath = Join-Path $PackagePathBase $Package
WriteLog "Adding Package $Package"
# Add-WindowsPackage -Path "$WinPEFFUPath\mount" -PackagePath $PackagePath | Out-Null
Invoke-Process cmd "/c ""$DandIEnv"" && dism /Image:$WinPEFFUPath\mount /Add-Package /PackagePath:$PackagePath" | Out-Null
Add-WindowsPackage -Path "$WinPEFFUPath\mount" -PackagePath $PackagePath | Out-Null
WriteLog "Adding package complete"
}
WriteLog "Copying $FFUDevelopmentPath\WinPEDeployFFUFiles\* to WinPE deploy media"