Added uninstall-outlook.ps1

This commit is contained in:
Markus Fleschutz 2025-01-14 08:25:14 +01:00
parent be9a93de82
commit 962d7d00b6
2 changed files with 27 additions and 3 deletions

View File

@ -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])"

View File

@ -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
}