Last active
February 15, 2022 22:09
-
-
Save wise-io/488166f41fa7e34cfd19dd5f69fdbd2a to your computer and use it in GitHub Desktop.
Silently Uninstall LibreOffice (x32 & x64)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Removes LibreOffice Installations (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 'LibreOffice*' } | 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