2026-07-19 22:06:07 +02:00
|
|
|
<#
|
|
|
|
|
.SYNOPSIS
|
|
|
|
|
Confirms removal of applications that require an extra safety warning.
|
|
|
|
|
#>
|
|
|
|
|
function Confirm-UnsafeAppRemoval {
|
2026-06-01 22:53:28 +02:00
|
|
|
param (
|
|
|
|
|
[string[]]$SelectedApps,
|
|
|
|
|
$Owner = $null
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Skip all warnings in Silent mode
|
|
|
|
|
if ($Silent) {
|
|
|
|
|
return $true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Microsoft Store warning
|
|
|
|
|
if ($SelectedApps -contains "Microsoft.WindowsStore") {
|
2026-09-10 21:18:43 +05:30
|
|
|
$result = Show-MessageBox -Message (Get-Translation -Key 'ConfirmRemoveStoreMessage') -Title (Get-Translation -Key 'ConfirmTitle') -Button 'YesNo' -Icon 'Warning' -Owner $Owner
|
2026-06-01 22:53:28 +02:00
|
|
|
|
2026-06-21 23:42:47 +07:00
|
|
|
if ($result -ne 'Yes') {
|
2026-06-01 22:53:28 +02:00
|
|
|
return $false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Windows Terminal warning
|
|
|
|
|
if ($SelectedApps -contains "Microsoft.WindowsTerminal") {
|
2026-09-10 21:18:43 +05:30
|
|
|
$result = Show-MessageBox -Message (Get-Translation -Key 'ConfirmRemoveTerminalMessage') -Title (Get-Translation -Key 'ConfirmTitle') -Button 'YesNo' -Icon 'Warning' -Owner $Owner
|
2026-06-01 22:53:28 +02:00
|
|
|
|
2026-06-21 23:42:47 +07:00
|
|
|
if ($result -ne 'Yes') {
|
2026-06-01 22:53:28 +02:00
|
|
|
return $false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $true
|
2026-06-21 23:42:47 +07:00
|
|
|
}
|