Skip to content

Instantly share code, notes, and snippets.

@wise-io
Created July 7, 2022 21:33
Show Gist options
  • Save wise-io/13e02861b04073079957d7277e40d768 to your computer and use it in GitHub Desktop.
Save wise-io/13e02861b04073079957d7277e40d768 to your computer and use it in GitHub Desktop.
Uninstalls Microsoft Silverlight
# Removes Microsoft Silverlight (x32 & x64)
$Paths = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall', 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
$App = Get-ChildItem -Path $Paths | Get-ItemProperty | Where-Object { $_.DisplayName -like 'Microsoft Silverlight' } | Select-Object
foreach ($Ver in $App) {
if ($Ver.UninstallString) {
$DisplayName = $Ver.DisplayName
$Uninst = $Ver.PSChildName
Write-Output "Uninstalling $DisplayName..."
cmd /c msiexec.exe /qn /uninstall $Uninst
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment