Files
Win11Debloat/Scripts/Helpers/Confirm-UnsafeAppRemoval.ps1
T
SashankandGitHub 32024662f3 Add localization framework for the GUI (en-US baseline) (#764)
Credit to @jmolinap2 for their work in #643, which was used as inspiration.
2026-09-10 17:48:43 +02:00

36 lines
1.0 KiB
PowerShell

<#
.SYNOPSIS
Confirms removal of applications that require an extra safety warning.
#>
function Confirm-UnsafeAppRemoval {
param (
[string[]]$SelectedApps,
$Owner = $null
)
# Skip all warnings in Silent mode
if ($Silent) {
return $true
}
# Microsoft Store warning
if ($SelectedApps -contains "Microsoft.WindowsStore") {
$result = Show-MessageBox -Message (Get-Translation -Key 'ConfirmRemoveStoreMessage') -Title (Get-Translation -Key 'ConfirmTitle') -Button 'YesNo' -Icon 'Warning' -Owner $Owner
if ($result -ne 'Yes') {
return $false
}
}
# Windows Terminal warning
if ($SelectedApps -contains "Microsoft.WindowsTerminal") {
$result = Show-MessageBox -Message (Get-Translation -Key 'ConfirmRemoveTerminalMessage') -Title (Get-Translation -Key 'ConfirmTitle') -Button 'YesNo' -Icon 'Warning' -Owner $Owner
if ($result -ne 'Yes') {
return $false
}
}
return $true
}