From 962d7d00b6509d16dcb477884b2ead5a7bdc778f Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Tue, 14 Jan 2025 08:25:14 +0100 Subject: [PATCH] Added uninstall-outlook.ps1 --- scripts/uninstall-new-outlook.ps1 | 6 +++--- scripts/uninstall-outlook.ps1 | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 scripts/uninstall-outlook.ps1 diff --git a/scripts/uninstall-new-outlook.ps1 b/scripts/uninstall-new-outlook.ps1 index 5e6159d0..e3cb6474 100644 --- a/scripts/uninstall-new-outlook.ps1 +++ b/scripts/uninstall-new-outlook.ps1 @@ -2,7 +2,7 @@ .SYNOPSIS Uninstalls the new Outlook .DESCRIPTION - This PowerShell script uninstalls the new Outlook application. + This PowerShell script uninstalls the new Outlook for Windows application. .EXAMPLE PS> ./uninstall-new-outlook.ps1 .LINK @@ -12,11 +12,11 @@ #> try { - "⏳ Uninstalling new Outlook..." + "⏳ Uninstalling new Outlook for Windows..." Remove-AppxProvisionedPackage -AllUsers -Online -PackageName (Get-AppxPackage Microsoft.OutlookForWindows).PackageFullName - "✅ New Outlook has been removed." + "✅ New Outlook for Windows has been removed." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/scripts/uninstall-outlook.ps1 b/scripts/uninstall-outlook.ps1 new file mode 100644 index 00000000..5c78b9c1 --- /dev/null +++ b/scripts/uninstall-outlook.ps1 @@ -0,0 +1,24 @@ +<# +.SYNOPSIS + Uninstalls Outlook +.DESCRIPTION + This PowerShell script uninstalls Outlook for Windows. +.EXAMPLE + PS> ./uninstall-outlook.ps1 +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + "⏳ Uninstalling Outlook for Windows..." + + Remove-AppxPackage -AllUsers -Package (Get-AppxPackage Microsoft.OutlookForWindows).PackageFullName + + "✅ Outlook for Windows has been removed." + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +}