File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -614,6 +614,13 @@ function Remove-WingetApps {
614614 param ([string []]$AppPatterns )
615615 Write-Log " --- $ ( T ' ProgBloatware' ) ---" - Level ' SECTION'
616616
617+ # Winget exit codes that mean "nothing to uninstall" — treat as SKIPPED, not WARN
618+ $notFoundCodes = @ (
619+ -1978335212 , # 0x8A15002C no package found to uninstall
620+ -1978335189 , # 0x8A15002B package not applicable / already gone
621+ -1978334966 # 0x8A15010A no installed package found
622+ )
623+
617624 $total = $AppPatterns.Count
618625 $current = 0
619626
@@ -643,6 +650,9 @@ function Remove-WingetApps {
643650 if ($LASTEXITCODE -eq 0 ) {
644651 Write-Log " $ ( T ' Removed' ) : $pattern " - Level ' SUCCESS'
645652 Add-Result - Section (T ' PhaseBloatware' ) - Item $pattern - Status ' OK' - Detail (T ' Removed' )
653+ } elseif ($LASTEXITCODE -in $notFoundCodes ) {
654+ Write-Log " $ ( T ' NotFound' ) : $pattern "
655+ Add-Result - Section (T ' PhaseBloatware' ) - Item $pattern - Status ' SKIPPED' - Detail (T ' NotInstalled' )
646656 } else {
647657 Write-Log " $ ( T ' RemoveExitCode' ) $LASTEXITCODE for: $pattern " - Level ' WARN'
648658 Add-Result - Section (T ' PhaseBloatware' ) - Item $pattern - Status ' WARN' - Detail " $ ( T ' RemoveExitCode' ) $LASTEXITCODE "
You can’t perform that action at this time.
0 commit comments