mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 02:56:17 +00:00
Show additional info during app removal with -Debug parameter
This commit is contained in:
@@ -373,28 +373,46 @@ function RemoveApps {
|
|||||||
# Windows 11 build 22000 or later
|
# Windows 11 build 22000 or later
|
||||||
try {
|
try {
|
||||||
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction Continue
|
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction Continue
|
||||||
|
|
||||||
|
if($DebugPreference -ne "SilentlyContinue") {
|
||||||
|
Write-Host "Removed $app for all users" -ForegroundColor DarkGray
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Host "Unable to remove $app for all users" -ForegroundColor Yellow
|
if($DebugPreference -ne "SilentlyContinue") {
|
||||||
Write-Host $psitem.Exception.StackTrace -ForegroundColor Gray
|
Write-Host "Unable to remove $app for all users" -ForegroundColor Yellow
|
||||||
|
Write-Host $psitem.Exception.StackTrace -ForegroundColor Gray
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Windows 10
|
# Windows 10
|
||||||
try {
|
try {
|
||||||
Get-AppxPackage -Name $app | Remove-AppxPackage -ErrorAction SilentlyContinue
|
Get-AppxPackage -Name $app | Remove-AppxPackage -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
if($DebugPreference -ne "SilentlyContinue") {
|
||||||
|
Write-Host "Removed $app for current user" -ForegroundColor DarkGray
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Host "Unable to remove $app for current user" -ForegroundColor Yellow
|
if($DebugPreference -ne "SilentlyContinue") {
|
||||||
Write-Host $psitem.Exception.StackTrace -ForegroundColor Gray
|
Write-Host "Unable to remove $app for current user" -ForegroundColor Yellow
|
||||||
|
Write-Host $psitem.Exception.StackTrace -ForegroundColor Gray
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Get-AppxPackage -Name $app -PackageTypeFilter Main, Bundle, Resource -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
|
Get-AppxPackage -Name $app -PackageTypeFilter Main, Bundle, Resource -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
if($DebugPreference -ne "SilentlyContinue") {
|
||||||
|
Write-Host "Removed $app for all users" -ForegroundColor DarkGray
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Host "Unable to remove $app for all users" -ForegroundColor Yellow
|
if($DebugPreference -ne "SilentlyContinue") {
|
||||||
Write-Host $psitem.Exception.StackTrace -ForegroundColor Gray
|
Write-Host "Unable to remove $app for all users" -ForegroundColor Yellow
|
||||||
|
Write-Host $psitem.Exception.StackTrace -ForegroundColor Gray
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -716,7 +734,7 @@ $WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\Current
|
|||||||
|
|
||||||
$global:Params = $PSBoundParameters
|
$global:Params = $PSBoundParameters
|
||||||
$global:FirstSelection = $true
|
$global:FirstSelection = $true
|
||||||
$SPParams = 'WhatIf', 'Confirm', 'Verbose', 'Silent', 'Sysprep'
|
$SPParams = 'WhatIf', 'Confirm', 'Verbose', 'Silent', 'Sysprep', 'Debug'
|
||||||
$SPParamCount = 0
|
$SPParamCount = 0
|
||||||
|
|
||||||
# Count how many SPParams exist within Params
|
# Count how many SPParams exist within Params
|
||||||
|
|||||||
Reference in New Issue
Block a user