From 52fd667ef93bce71570552b68fd42364862e1b6e Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Fri, 28 Jun 2024 14:43:13 +0000 Subject: [PATCH] Compile Winutil --- winutil.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/winutil.ps1 b/winutil.ps1 index c1afe572..1e46549c 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -1118,7 +1118,13 @@ function Remove-ProvisionedPackages([switch] $keepSecurity = $false) { $status = "Removing Provisioned $($appx.PackageName)" Write-Progress -Activity "Removing Provisioned Apps" -Status $status -PercentComplete ($counter++/$appxProvisionedPackages.Count*100) - Remove-AppxProvisionedPackage -Path $scratchDir -PackageName $appx.PackageName -ErrorAction SilentlyContinue + try { + Remove-AppxProvisionedPackage -Path $scratchDir -PackageName $appx.PackageName -ErrorAction SilentlyContinue + } + catch { + Write-Host "Application $($appx.PackageName) could not be removed" + continue + } } Write-Progress -Activity "Removing Provisioned Apps" -Status "Ready" -Completed }