Added option to remove mail and related apps (#13)

This commit is contained in:
Raphire
2023-11-19 23:02:54 +01:00
parent 78d2332077
commit e8dbbd9987
4 changed files with 79 additions and 10 deletions

View File

@@ -96,9 +96,7 @@
# #
#*Microsoft.GetHelp* # Required for some Windows 11 Troubleshooters #*Microsoft.GetHelp* # Required for some Windows 11 Troubleshooters
#*Microsoft.MSPaint* # Paint 3D #*Microsoft.MSPaint* # Paint 3D
#*Microsoft.OutlookForWindows* # New mail app
#*Microsoft.Paint* # Classic Paint #*Microsoft.Paint* # Classic Paint
#*Microsoft.People* # Required for & included with Mail & Calendar
#*Microsoft.PowerAutomateDesktop* #*Microsoft.PowerAutomateDesktop*
#*Microsoft.RemoteDesktop* #*Microsoft.RemoteDesktop*
#*Microsoft.ScreenSketch* # Snipping Tool #*Microsoft.ScreenSketch* # Snipping Tool
@@ -106,7 +104,6 @@
#*Microsoft.Windows.Photos* #*Microsoft.Windows.Photos*
#*Microsoft.WindowsCalculator* #*Microsoft.WindowsCalculator*
#*Microsoft.WindowsCamera* #*Microsoft.WindowsCamera*
#*Microsoft.windowscommunicationsapps* # Mail & Calendar
#*Microsoft.WindowsStore* # Microsoft Store, WARNING: This app cannot be reinstalled! #*Microsoft.WindowsStore* # Microsoft Store, WARNING: This app cannot be reinstalled!
#*Microsoft.WindowsTerminal* # New default terminal app in windows 11 #*Microsoft.WindowsTerminal* # New default terminal app in windows 11
#*Microsoft.Xbox.TCUI* # UI framework, seems to be required for MS store, photos and certain games #*Microsoft.Xbox.TCUI* # UI framework, seems to be required for MS store, photos and certain games
@@ -116,8 +113,11 @@
#*Microsoft.ZuneMusic* # Modern Media Player #*Microsoft.ZuneMusic* # Modern Media Player
# The apps below will NOT be uninstalled unless selected during the custom setup selection or when # The apps below will NOT be uninstalled unless selected during the custom setup selection or when
# launching the script with the '-RemoveGamingApps' parameter. # launching the script with the specific parameters found in the README.md file.
# #
#*Microsoft.GamingApp* # Modern Xbox Gaming App, required for installing some PC games #*Microsoft.GamingApp* # Modern Xbox Gaming App, required for installing some PC games
#*Microsoft.OutlookForWindows* # New mail app: Outlook for Windows
#*Microsoft.People* # Required for & included with Mail & Calendar
#*Microsoft.windowscommunicationsapps* # Mail & Calendar
#*Microsoft.XboxGameOverlay* # Game overlay, required/useful for some games #*Microsoft.XboxGameOverlay* # Game overlay, required/useful for some games
#*Microsoft.XboxGamingOverlay* # Game overlay, required/useful for some games #*Microsoft.XboxGamingOverlay* # Game overlay, required/useful for some games

View File

@@ -22,8 +22,9 @@ through all the settings yourself, or removing apps one by one!
------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------
Using the custom mode you can Using the custom mode you can
------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------
- Remove bloatware apps, the list can be found in the 'Appslist.txt' file. - Remove bloatware apps, check the full list in the 'Appslist.txt' file.
- Remove gaming-related apps, the list can be found in the 'GamingAppslist.txt' file. - Remove gaming-related apps, check the full list in the 'GamingAppslist.txt' file.
- Remove Mail & Calendar, People or new Outlook for Windows apps.
- Remove all pinned apps from the start menu. NOTE: This applies to all existing and new users. (Windows 11 build 22621+) - Remove all pinned apps from the start menu. NOTE: This applies to all existing and new users. (Windows 11 build 22621+)
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads. - Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
- Disable bing search, bing AI & cortana in windows search. - Disable bing search, bing AI & cortana in windows search.

View File

@@ -25,7 +25,7 @@ You can pick and choose exactly which modifications you want the script to make,
Give you access to even more options and allow you to customize the script to your exact needs. Give you access to even more options and allow you to customize the script to your exact needs.
In this mode you'll be able to make any of the following changes: In this mode you'll be able to make any of the following changes:
- Remove all bloatware apps from [this list](#click-for-list-of-bloat-that-is-removed) and optionally also remove gaming-related apps. - Remove all bloatware apps from [this list](#click-for-list-of-bloat-that-is-removed) and optionally also remove communication and gaming-related apps.
- Remove all pinned apps from the start menu. NOTE: This applies to all existing and new users. (Windows 11 only) - Remove all pinned apps from the start menu. NOTE: This applies to all existing and new users. (Windows 11 only)
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads. - Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
- Disable bing search, bing AI & cortana in windows search. - Disable bing search, bing AI & cortana in windows search.
@@ -79,6 +79,8 @@ To run the script without any user input, simply add parameters at the end, exam
| -RunDefaults | Run the script with the default settings. | | -RunDefaults | Run the script with the default settings. |
| -RemoveApps | Remove all bloatware apps from [this list](#click-for-list-of-bloat-that-is-removed). | | -RemoveApps | Remove all bloatware apps from [this list](#click-for-list-of-bloat-that-is-removed). |
| -RemoveGamingApps | Remove the Xbox App and Xbox Gamebar. | | -RemoveGamingApps | Remove the Xbox App and Xbox Gamebar. |
| -RemoveCommApps | Remove the Mail, Calender, and People apps. |
| -RemoveW11Outlook | Remove the new Outlook for Windows app. |
| -ClearStart | Remove all pinned apps from the start menu. NOTE: This applies to all existing and new users. (Windows 11 update 22H2 or later only) | | -ClearStart | Remove all pinned apps from the start menu. NOTE: This applies to all existing and new users. (Windows 11 update 22H2 or later only) |
| -DisableTelemetry | Disable telemetry, diagnostic data & targeted ads. | | -DisableTelemetry | Disable telemetry, diagnostic data & targeted ads. |
| -DisableBing | Disable bing search, bing AI & cortana in windows search. | | -DisableBing | Disable bing search, bing AI & cortana in windows search. |

View File

@@ -8,6 +8,8 @@ param
[Parameter(ValueFromPipeline = $true)][switch]$RunWin11Defaults, [Parameter(ValueFromPipeline = $true)][switch]$RunWin11Defaults,
[Parameter(ValueFromPipeline = $true)][switch]$RemoveApps, [Parameter(ValueFromPipeline = $true)][switch]$RemoveApps,
[Parameter(ValueFromPipeline = $true)][switch]$RemoveGamingApps, [Parameter(ValueFromPipeline = $true)][switch]$RemoveGamingApps,
[Parameter(ValueFromPipeline = $true)][switch]$RemoveCommApps,
[Parameter(ValueFromPipeline = $true)][switch]$RemoveW11Outlook,
[Parameter(ValueFromPipeline = $true)][switch]$DisableTelemetry, [Parameter(ValueFromPipeline = $true)][switch]$DisableTelemetry,
[Parameter(ValueFromPipeline = $true)][switch]$DisableBingSearches, [Parameter(ValueFromPipeline = $true)][switch]$DisableBingSearches,
[Parameter(ValueFromPipeline = $true)][switch]$DisableBing, [Parameter(ValueFromPipeline = $true)][switch]$DisableBing,
@@ -251,6 +253,32 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (
if ($( Read-Host -Prompt "Remove pre-installed bloatware apps? (y/n)" ) -eq 'y') { if ($( Read-Host -Prompt "Remove pre-installed bloatware apps? (y/n)" ) -eq 'y') {
$PSBoundParameters.Add('RemoveApps', $RemoveApps) $PSBoundParameters.Add('RemoveApps', $RemoveApps)
# Show options for removing communication-related apps, only continue on valid input
Do {
Write-Output ""
Write-Output " Options:"
Write-Output " (n) Don't remove communication-related apps"
Write-Output " (1) Remove Mail, Calender, People and Outlook for Windows apps"
Write-Output " (2) Only remove Mail, Calender and People apps"
Write-Output " (3) Only remove Outlook for Windows app"
$RemoveCommAppInput = Read-Host " Also remove communication-related apps? (n/1/2/3)"
}
while ($RemoveCommAppInput -ne 'n' -and $RemoveCommAppInput -ne '0' -and $RemoveCommAppInput -ne '1' -and $RemoveCommAppInput -ne '2' -and $RemoveCommAppInput -ne '3')
# Select correct taskbar search option based on user input
switch ($RemoveCommAppInput) {
'1' {
$PSBoundParameters.Add('RemoveCommApps', $RemoveCommApps)
$PSBoundParameters.Add('RemoveW11Outlook', $RemoveW11Outlook)
}
'2' {
$PSBoundParameters.Add('RemoveCommApps', $RemoveCommApps)
}
'3' {
$PSBoundParameters.Add('RemoveW11Outlook', $RemoveW11Outlook)
}
}
Write-Output "" Write-Output ""
if ($( Read-Host -Prompt " Also remove gaming-related apps such as the Xbox App and Xbox Gamebar? (y/n)" ) -eq 'y') { if ($( Read-Host -Prompt " Also remove gaming-related apps such as the Xbox App and Xbox Gamebar? (y/n)" ) -eq 'y') {
@@ -319,12 +347,12 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (
Do { Do {
Write-Output "" Write-Output ""
Write-Output " Options:" Write-Output " Options:"
Write-Output " (0) No change" Write-Output " (n) No change"
Write-Output " (1) Hide search icon from the taskbar" Write-Output " (1) Hide search icon from the taskbar"
Write-Output " (2) Show search icon on the taskbar" Write-Output " (2) Show search icon on the taskbar"
Write-Output " (3) Show search icon with label on the taskbar" Write-Output " (3) Show search icon with label on the taskbar"
Write-Output " (4) Show search box on the taskbar" Write-Output " (4) Show search box on the taskbar"
$TbSearchInput = Read-Host " Hide or change the search icon on the taskbar? (0/1/2/3/4)" $TbSearchInput = Read-Host " Hide or change the search icon on the taskbar? (n/1/2/3/4)"
} }
while ($TbSearchInput -ne 'n' -and $TbSearchInput -ne '0' -and $TbSearchInput -ne '1' -and $TbSearchInput -ne '2' -and $TbSearchInput -ne '3' -and $TbSearchInput -ne '4') while ($TbSearchInput -ne 'n' -and $TbSearchInput -ne '0' -and $TbSearchInput -ne '1' -and $TbSearchInput -ne '2' -and $TbSearchInput -ne '3' -and $TbSearchInput -ne '4')
@@ -477,7 +505,45 @@ else {
# Execute all selected/provided parameters # Execute all selected/provided parameters
switch ($PSBoundParameters.Keys) { switch ($PSBoundParameters.Keys) {
'RemoveApps' { 'RemoveApps' {
RemoveApps "$PSScriptRoot/Appslist.txt" "> Removing pre-installed windows apps..." RemoveApps "$PSScriptRoot/Appslist.txt" "> Removing pre-installed windows bloatware..."
continue
}
'RemoveCommApps' {
Write-Output "> Removing Mail, Calendar and People apps..."
$appsList = '*Microsoft.windowscommunicationsapps*', '*Microsoft.People*'
Foreach ($app in $appsList)
{
$appString = $app.Trim('*')
Write-Output "Attempting to remove $appString..."
# Remove installed app for all existing users
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage
# Remove provisioned app from OS image, so the app won't be installed for any new users
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
}
Write-Output ""
continue
}
'RemoveW11Outlook' {
Write-Output "> Removing new Outlook for Windows app..."
$appsList = '*Microsoft.OutlookForWindows*'
Foreach ($app in $appsList)
{
$appString = $app.Trim('*')
Write-Output "Attempting to remove $appString..."
# Remove installed app for all existing users
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage
# Remove provisioned app from OS image, so the app won't be installed for any new users
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
}
Write-Output ""
continue continue
} }
'RemoveGamingApps' { 'RemoveGamingApps' {