PowerShell/scripts/uninstall-nine-zip.ps1

25 lines
573 B
PowerShell
Raw Normal View History

2023-10-31 13:03:45 +01:00
<#
2022-07-15 17:12:01 +02:00
.SYNOPSIS
Uninstalls 9 ZIP
.DESCRIPTION
This PowerShell script uninstalls 9 ZIP from the local computer.
.EXAMPLE
PS> ./uninstall-nine-zip
.LINK
https://github.com/fleschutz/talk2windows
2022-09-06 21:42:04 +02:00
.NOTES
Author: Markus Fleschutz | License: CC0
2022-07-15 17:12:01 +02:00
#>
try {
2022-09-11 11:57:15 +02:00
"Uninstalling 9 ZIP, please wait..."
2022-07-15 17:12:01 +02:00
& winget uninstall "9 ZIP - open rar, zip, 7zip, gzip"
if ($lastExitCode -ne "0") { throw "Can't uninstall 9 ZIP, is it installed?" }
2022-09-11 11:57:15 +02:00
"9 ZIP is uninstalled now."
2022-07-15 17:12:01 +02:00
exit 0 # success
} catch {
2022-09-11 11:57:15 +02:00
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
2022-07-15 17:12:01 +02:00
exit 1
2022-09-11 11:57:15 +02:00
}