18 lines
1.0 KiB
PowerShell
18 lines
1.0 KiB
PowerShell
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 )
|
|
{
|
|
Write-Output "Found uninstall string: ${UninstallString}"
|
|
$UninstallString = (Get-ItemProperty -Path $RegKey).UninstallString
|
|
$UninstallProgram = $UninstallString -replace ' -maintain plugin', ''
|
|
Write-Output "Running: ""${UninstallProgram}"" -uninstall"
|
|
Try { Start-Process "${UninstallProgram}" -ArgumentList "-uninstall" -Wait }
|
|
Catch { Write-Error $_.Exception.Message }
|
|
}
|
|
Else { Write-Output "Adobe Flash Player is not installed" }
|
|
}
|
|
Else { Write-Output "Must have administrative privileges to uninstall Adobe Flash" } |