mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-10-08 14:36:48 +00:00
Credit to @jmolinap2 for their work in #643, which was used as inspiration.
36 lines
1.0 KiB
PowerShell
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
|
|
}
|