2020-10-25 09:39:25 -04:00
|
|
|
If ( IsAdmin )
|
|
|
|
|
{
|
|
|
|
|
If ( Test-Path 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player NPAPI' )
|
|
|
|
|
{ $RegKey = 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player NPAPI' }
|
|
|
|
|
ElseIf ( Test-Path 'HKLM:SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player NPAPI' )
|
|
|
|
|
{ $RegKey = 'HKLM:SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player NPAPI' }
|
|
|
|
|
If ( $RegKey )
|
|
|
|
|
{
|
2023-10-05 13:11:38 -04:00
|
|
|
Write-Output "Found uninstall string: ${UninstallString}"
|
2020-10-25 09:39:25 -04:00
|
|
|
$UninstallString = (Get-ItemProperty -Path $RegKey).UninstallString
|
|
|
|
|
$UninstallProgram = $UninstallString -replace ' -maintain plugin', ''
|
2023-10-05 13:11:38 -04:00
|
|
|
Write-Output "Running: ""${UninstallProgram}"" -uninstall"
|
2020-10-25 09:39:25 -04:00
|
|
|
Try { Start-Process "${UninstallProgram}" -ArgumentList "-uninstall" -Wait }
|
2023-10-05 13:17:18 -04:00
|
|
|
Catch { Write-Error $_.Exception.Message }
|
2020-10-25 09:39:25 -04:00
|
|
|
}
|
2023-10-05 13:11:38 -04:00
|
|
|
Else { Write-Output "Adobe Flash Player is not installed" }
|
2020-10-25 09:39:25 -04:00
|
|
|
}
|
2023-10-05 13:11:38 -04:00
|
|
|
Else { Write-Output "Must have administrative privileges to uninstall Adobe Flash" }
|