mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 02:56:17 +00:00
Improved app removal process, added support for removing more apps and more (#43)
* Added option to remove OneDrive and Edge via winget (#9)(#38) * Added Microsoft Journal to Appslist.txt * Added menu option for removing apps without making other changes Other changes in this release: - Apps are now properly removed for all users - LastSettings file renamed to SavedSettings - Minor changes to menus, prompts & comments - Cleaned up & refactored script to improve readability
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
LastSettings
|
LastSettings
|
||||||
|
SavedSettings
|
||||||
CustomAppsList
|
CustomAppsList
|
||||||
|
|||||||
222
Appslist.txt
222
Appslist.txt
@@ -1,92 +1,93 @@
|
|||||||
# The apps below this line WILL be uninstalled. If you wish to KEEP any of the apps below
|
# The apps below this line WILL be uninstalled. If you wish to KEEP any of the apps below
|
||||||
# simply add a # character in front of the specific app in the list below.
|
# simply add a # character in front of the specific app in the list below.
|
||||||
#
|
#
|
||||||
*Clipchamp.Clipchamp*
|
Clipchamp.Clipchamp
|
||||||
*Microsoft.3DBuilder*
|
Microsoft.3DBuilder
|
||||||
*Microsoft.549981C3F5F10* #Cortana app
|
Microsoft.549981C3F5F10 #Cortana app
|
||||||
*Microsoft.BingFinance*
|
Microsoft.BingFinance
|
||||||
*Microsoft.BingFoodAndDrink*
|
Microsoft.BingFoodAndDrink
|
||||||
*Microsoft.BingHealthAndFitness*
|
Microsoft.BingHealthAndFitness
|
||||||
*Microsoft.BingNews*
|
Microsoft.BingNews
|
||||||
*Microsoft.BingSports*
|
Microsoft.BingSports
|
||||||
*Microsoft.BingTranslator*
|
Microsoft.BingTranslator
|
||||||
*Microsoft.BingTravel*
|
Microsoft.BingTravel
|
||||||
*Microsoft.BingWeather*
|
Microsoft.BingWeather
|
||||||
*Microsoft.Getstarted* # Cannot be uninstalled in Windows 11
|
Microsoft.Getstarted # Cannot be uninstalled in Windows 11
|
||||||
*Microsoft.Messaging*
|
Microsoft.Messaging
|
||||||
*Microsoft.Microsoft3DViewer*
|
Microsoft.Microsoft3DViewer
|
||||||
*Microsoft.MicrosoftOfficeHub*
|
Microsoft.MicrosoftJournal
|
||||||
*Microsoft.MicrosoftPowerBIForWindows*
|
Microsoft.MicrosoftOfficeHub
|
||||||
*Microsoft.MicrosoftSolitaireCollection*
|
Microsoft.MicrosoftPowerBIForWindows
|
||||||
*Microsoft.MicrosoftStickyNotes*
|
Microsoft.MicrosoftSolitaireCollection
|
||||||
*Microsoft.MixedReality.Portal*
|
Microsoft.MicrosoftStickyNotes
|
||||||
*Microsoft.NetworkSpeedTest*
|
Microsoft.MixedReality.Portal
|
||||||
*Microsoft.News*
|
Microsoft.NetworkSpeedTest
|
||||||
*Microsoft.Office.OneNote*
|
Microsoft.News
|
||||||
*Microsoft.Office.Sway*
|
Microsoft.Office.OneNote
|
||||||
*Microsoft.OneConnect*
|
Microsoft.Office.Sway
|
||||||
*Microsoft.Print3D*
|
Microsoft.OneConnect
|
||||||
*Microsoft.SkypeApp*
|
Microsoft.Print3D
|
||||||
*Microsoft.Todos*
|
Microsoft.SkypeApp
|
||||||
*Microsoft.WindowsAlarms*
|
Microsoft.Todos
|
||||||
*Microsoft.WindowsFeedbackHub*
|
Microsoft.WindowsAlarms
|
||||||
*Microsoft.WindowsMaps*
|
Microsoft.WindowsFeedbackHub
|
||||||
*Microsoft.WindowsSoundRecorder*
|
Microsoft.WindowsMaps
|
||||||
*Microsoft.XboxApp* # Old Xbox Console Companion App, no longer supported
|
Microsoft.WindowsSoundRecorder
|
||||||
*Microsoft.ZuneVideo*
|
Microsoft.XboxApp # Old Xbox Console Companion App, no longer supported
|
||||||
*MicrosoftCorporationII.MicrosoftFamily* # Family Safety App
|
Microsoft.ZuneVideo
|
||||||
*MicrosoftTeams* # Only removes the personal version (MS Store), does not remove business/enterprise version of teams
|
MicrosoftCorporationII.MicrosoftFamily # Family Safety App
|
||||||
|
MicrosoftTeams # Only removes the personal version (MS Store), does not remove business/enterprise version of teams
|
||||||
|
|
||||||
*ACGMediaPlayer*
|
ACGMediaPlayer
|
||||||
*ActiproSoftwareLLC*
|
ActiproSoftwareLLC
|
||||||
*AdobeSystemsIncorporated.AdobePhotoshopExpress*
|
AdobeSystemsIncorporated.AdobePhotoshopExpress
|
||||||
*Amazon.com.Amazon*
|
Amazon.com.Amazon
|
||||||
*AmazonVideo.PrimeVideo*
|
AmazonVideo.PrimeVideo
|
||||||
*Asphalt8Airborne*
|
Asphalt8Airborne
|
||||||
*AutodeskSketchBook*
|
AutodeskSketchBook
|
||||||
*CaesarsSlotsFreeCasino*
|
CaesarsSlotsFreeCasino
|
||||||
*COOKINGFEVER*
|
COOKINGFEVER
|
||||||
*CyberLinkMediaSuiteEssentials*
|
CyberLinkMediaSuiteEssentials
|
||||||
*DisneyMagicKingdoms*
|
DisneyMagicKingdoms
|
||||||
*Disney*
|
Disney
|
||||||
*Dolby*
|
Dolby
|
||||||
*DrawboardPDF*
|
DrawboardPDF
|
||||||
*Duolingo-LearnLanguagesforFree*
|
Duolingo-LearnLanguagesforFree
|
||||||
*EclipseManager*
|
EclipseManager
|
||||||
*Facebook*
|
Facebook
|
||||||
*FarmVille2CountryEscape*
|
FarmVille2CountryEscape
|
||||||
*fitbit*
|
fitbit
|
||||||
*Flipboard*
|
Flipboard
|
||||||
*HiddenCity*
|
HiddenCity
|
||||||
*HULULLC.HULUPLUS*
|
HULULLC.HULUPLUS
|
||||||
*iHeartRadio*
|
iHeartRadio
|
||||||
*Instagram*
|
Instagram
|
||||||
*king.com.BubbleWitch3Saga*
|
king.com.BubbleWitch3Saga
|
||||||
*king.com.CandyCrushSaga*
|
king.com.CandyCrushSaga
|
||||||
*king.com.CandyCrushSodaSaga*
|
king.com.CandyCrushSodaSaga
|
||||||
*LinkedInforWindows*
|
LinkedInforWindows
|
||||||
*MarchofEmpires*
|
MarchofEmpires
|
||||||
*Netflix*
|
Netflix
|
||||||
*NYTCrossword*
|
NYTCrossword
|
||||||
*OneCalendar*
|
OneCalendar
|
||||||
*PandoraMediaInc*
|
PandoraMediaInc
|
||||||
*PhototasticCollage*
|
PhototasticCollage
|
||||||
*PicsArt-PhotoStudio*
|
PicsArt-PhotoStudio
|
||||||
*Plex*
|
Plex
|
||||||
*PolarrPhotoEditorAcademicEdition*
|
PolarrPhotoEditorAcademicEdition
|
||||||
*Royal Revolt*
|
Royal Revolt
|
||||||
*Shazam*
|
Shazam
|
||||||
*Sidia.LiveWallpaper*
|
Sidia.LiveWallpaper
|
||||||
*SlingTV*
|
SlingTV
|
||||||
*Speed Test*
|
Speed Test
|
||||||
*Spotify*
|
Spotify
|
||||||
*TikTok*
|
TikTok
|
||||||
*TuneInRadio*
|
TuneInRadio
|
||||||
*Twitter*
|
Twitter
|
||||||
*Viber*
|
Viber
|
||||||
*WinZipUniversal*
|
WinZipUniversal
|
||||||
*Wunderlist*
|
Wunderlist
|
||||||
*XING*
|
XING
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -94,32 +95,33 @@
|
|||||||
# The apps below this line will NOT be uninstalled. If you wish to REMOVE any of the apps below
|
# The apps below this line will NOT be uninstalled. If you wish to REMOVE any of the apps below
|
||||||
# simply remove the # character in front of the specific app.
|
# simply remove the # character in front of the specific app.
|
||||||
#
|
#
|
||||||
#*Microsoft.GetHelp* # Required for some Windows 11 Troubleshooters
|
#Microsoft.Edge # Edge browser (Can only be uninstalled in European Economic Area)
|
||||||
#*Microsoft.MicrosoftEdge.Stable* # Edge browser
|
#Microsoft.GetHelp # Required for some Windows 11 Troubleshooters
|
||||||
#*Microsoft.MSPaint* # Paint 3D
|
#Microsoft.MSPaint # Paint 3D
|
||||||
#*Microsoft.Paint* # Classic Paint
|
#Microsoft.OneDrive # OneDrive consumer
|
||||||
#*Microsoft.ScreenSketch* # Snipping Tool
|
#Microsoft.Paint # Classic Paint
|
||||||
#*Microsoft.Whiteboard* # Only preinstalled on devices with touchscreen and/or pen support
|
#Microsoft.ScreenSketch # Snipping Tool
|
||||||
#*Microsoft.Windows.Photos*
|
#Microsoft.Whiteboard # Only preinstalled on devices with touchscreen and/or pen support
|
||||||
#*Microsoft.WindowsCalculator*
|
#Microsoft.Windows.Photos
|
||||||
#*Microsoft.WindowsCamera*
|
#Microsoft.WindowsCalculator
|
||||||
#*Microsoft.WindowsStore* # Microsoft Store, WARNING: This app cannot be reinstalled!
|
#Microsoft.WindowsCamera
|
||||||
#*Microsoft.WindowsTerminal* # New default terminal app in windows 11
|
#Microsoft.WindowsStore # Microsoft Store, WARNING: This app cannot be reinstalled!
|
||||||
#*Microsoft.Xbox.TCUI* # UI framework, seems to be required for MS store, photos and certain games
|
#Microsoft.WindowsTerminal # New default terminal app in windows 11
|
||||||
#*Microsoft.XboxIdentityProvider* # Xbox sign-in framework, required for some games
|
#Microsoft.Xbox.TCUI # UI framework, seems to be required for MS store, photos and certain games
|
||||||
#*Microsoft.XboxSpeechToTextOverlay* # Might be required for some games, WARNING: This app cannot be reinstalled!
|
#Microsoft.XboxIdentityProvider # Xbox sign-in framework, required for some games
|
||||||
#*Microsoft.YourPhone* # Phone link
|
#Microsoft.XboxSpeechToTextOverlay # Might be required for some games, WARNING: This app cannot be reinstalled!
|
||||||
#*Microsoft.ZuneMusic* # Modern Media Player
|
#Microsoft.YourPhone # Phone link
|
||||||
|
#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 specific parameters found in the README.md file.
|
# 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.OutlookForWindows # New mail app: Outlook for Windows
|
||||||
#*Microsoft.People* # Required for & included with Mail & Calendar
|
#Microsoft.People # Required for & included with Mail & Calendar
|
||||||
#*Microsoft.PowerAutomateDesktop*
|
#Microsoft.PowerAutomateDesktop
|
||||||
#*Microsoft.RemoteDesktop*
|
#Microsoft.RemoteDesktop
|
||||||
#*Microsoft.windowscommunicationsapps* # 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
|
||||||
#*Windows.DevHome*
|
#Windows.DevHome
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
Win11Debloat - Setup
|
Win11Debloat Script - Default Mode
|
||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
Win11Debloat will make the following changes:
|
Win11Debloat will make the following changes:
|
||||||
- Remove the default selection of bloatware apps, the list can be found in the 'Appslist.txt' file.
|
- Remove the default selection of apps, the list can be found in the 'Appslist.txt' file.
|
||||||
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
|
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
|
||||||
- Disable & remove bing search & cortana in Windows search.
|
- Disable & remove bing search & cortana in Windows search.
|
||||||
- Disable tips & tricks on the lockscreen. (This may change your lockscreen wallpaper)
|
- Disable tips & tricks on the lockscreen. (This may change your lockscreen wallpaper)
|
||||||
- Disable tips, tricks and suggestions in the start menu and settings, and ads in windows explorer.
|
- Disable tips, tricks, suggestions and ads in start, settings, notifications and more.
|
||||||
- Disable Windows Copilot. (Windows 11 build 22621+)
|
- Disable Windows Copilot. (Windows 11 build 22621+)
|
||||||
- Show file extensions for known file types.
|
- Show file extensions for known file types.
|
||||||
- Disable the widget service & hide the icon from the taskbar.
|
- Disable the widget service & hide the icon from the taskbar.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
Win11Debloat - Information
|
Win11Debloat Script - Information
|
||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
Win11Debloat is a simple and lightweight powershell script that removes pre-installed
|
Win11Debloat is a simple and lightweight powershell script that removes pre-installed
|
||||||
windows bloatware apps, disables telemetry and declutters the experience by disabling
|
windows bloatware apps, disables telemetry and declutters the experience by disabling
|
||||||
@@ -7,12 +7,12 @@ or removing intrusive interface elements, ads and more. No need to painstakingly
|
|||||||
through all the settings yourself, or removing apps one by one!
|
through all the settings yourself, or removing apps one by one!
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
Using the default configuration the script will
|
Using the default mode the script will
|
||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
- Remove the default selection of bloatware apps, the list can be found in the 'Appslist.txt' file.
|
- Remove the default selection of apps, the list can be found in the 'Appslist.txt' file.
|
||||||
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
|
- Disable telemetry, diagnostic data, app-launch tracking & targeted ads.
|
||||||
- Disable & remove bing search & cortana in Windows search.
|
- Disable & remove bing search & cortana in Windows search.
|
||||||
- Disable tips, tricks, suggestions and ads in start, settings, notifications, windows explorer, and on the lockscreen.
|
- Disable tips, tricks, suggestions and ads in start, settings, notifications and more.
|
||||||
- Disable Windows Copilot. (Windows 11 only)
|
- Disable Windows Copilot. (Windows 11 only)
|
||||||
- Show file extensions for known file types.
|
- Show file extensions for known file types.
|
||||||
- Disable the widget service & hide the icon from the taskbar.
|
- Disable the widget service & hide the icon from the taskbar.
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
-------------------------------------------------------------------------------------------
|
|
||||||
Win11Debloat - Setup
|
|
||||||
-------------------------------------------------------------------------------------------
|
|
||||||
(1) Default mode: Run the script with the default settings
|
|
||||||
(2) Custom mode: Manually select what changes you want Win11Debloat to make
|
|
||||||
@@ -71,6 +71,7 @@ Win11Debloat has many options, but not all of these options are executed when ru
|
|||||||
- Microsoft.Getstarted (Cannot be uninstalled in Windows 11)
|
- Microsoft.Getstarted (Cannot be uninstalled in Windows 11)
|
||||||
- Microsoft.Messaging
|
- Microsoft.Messaging
|
||||||
- Microsoft.Microsoft3DViewer
|
- Microsoft.Microsoft3DViewer
|
||||||
|
- Microsoft.MicrosoftJournal
|
||||||
- Microsoft.MicrosoftOfficeHub
|
- Microsoft.MicrosoftOfficeHub
|
||||||
- Microsoft.MicrosoftPowerBIForWindows
|
- Microsoft.MicrosoftPowerBIForWindows
|
||||||
- Microsoft.MicrosoftSolitaireCollection
|
- Microsoft.MicrosoftSolitaireCollection
|
||||||
@@ -156,10 +157,11 @@ Win11Debloat has many options, but not all of these options are executed when ru
|
|||||||
<blockquote>
|
<blockquote>
|
||||||
|
|
||||||
General apps that are not removed by default:
|
General apps that are not removed by default:
|
||||||
|
- Microsoft.Edge (Edge browser, only removeable in the EEA)
|
||||||
- Microsoft.GetHelp (Required for some Windows 11 Troubleshooters)
|
- Microsoft.GetHelp (Required for some Windows 11 Troubleshooters)
|
||||||
- Microsoft.MicrosoftEdge.Stable (Edge browser)
|
|
||||||
- Microsoft.MSPaint (Paint 3D)
|
- Microsoft.MSPaint (Paint 3D)
|
||||||
- Microsoft.OutlookForWindows* (New mail app)
|
- Microsoft.OutlookForWindows* (New mail app)
|
||||||
|
- Microsoft.OneDrive (OneDrive consumer)
|
||||||
- Microsoft.Paint (Classic Paint)
|
- Microsoft.Paint (Classic Paint)
|
||||||
- Microsoft.People* (Required for & included with Mail & Calendar)
|
- Microsoft.People* (Required for & included with Mail & Calendar)
|
||||||
- Microsoft.ScreenSketch (Snipping Tool)
|
- Microsoft.ScreenSketch (Snipping Tool)
|
||||||
|
|||||||
327
Win11Debloat.ps1
327
Win11Debloat.ps1
@@ -87,6 +87,12 @@ function ShowAppSelectionForm {
|
|||||||
|
|
||||||
# Set filePath where Appslist can be found
|
# Set filePath where Appslist can be found
|
||||||
$appsFile = "$PSScriptRoot/Appslist.txt"
|
$appsFile = "$PSScriptRoot/Appslist.txt"
|
||||||
|
$listOfApps = ""
|
||||||
|
|
||||||
|
if ($onlyInstalledCheckBox.Checked -and ($global:wingetInstalled -eq $true)) {
|
||||||
|
# Get list of installed apps via winget
|
||||||
|
$listOfApps = winget list --accept-source-agreements --disable-interactivity
|
||||||
|
}
|
||||||
|
|
||||||
# Go through appslist and add items one by one to the selectionBox
|
# Go through appslist and add items one by one to the selectionBox
|
||||||
Foreach ($app in (Get-Content -Path $appsFile | Where-Object { $_ -notmatch '^\s*$' } )) {
|
Foreach ($app in (Get-Content -Path $appsFile | Where-Object { $_ -notmatch '^\s*$' } )) {
|
||||||
@@ -110,11 +116,19 @@ function ShowAppSelectionForm {
|
|||||||
|
|
||||||
# Make sure appString is not empty
|
# Make sure appString is not empty
|
||||||
if ($appString.length -gt 0) {
|
if ($appString.length -gt 0) {
|
||||||
if($onlyInstalledCheckBox.Checked) {
|
if ($onlyInstalledCheckBox.Checked) {
|
||||||
# onlyInstalledCheckBox is checked, check if app is installed before adding to selectionBox
|
# onlyInstalledCheckBox is checked, check if app is installed before adding it to selectionBox
|
||||||
$installed = Get-AppxPackage -Name $app
|
if ($listOfApps -like ("* " + $appString + " *")) {
|
||||||
|
$installed = "installed"
|
||||||
|
}
|
||||||
|
elseif (($appString -eq "Microsoft.Edge") -and ($listOfApps -like "* XPFFTQ037JWMHS *")) {
|
||||||
|
$installed = "installed"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$installed = Get-AppxPackage -Name $app
|
||||||
|
}
|
||||||
|
|
||||||
if($installed.length -eq 0) {
|
if ($installed.length -eq 0) {
|
||||||
# App is not installed, continue to next item without adding this app to the selectionBox
|
# App is not installed, continue to next item without adding this app to the selectionBox
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -143,7 +157,7 @@ function ShowAppSelectionForm {
|
|||||||
$button1.Name = "saveButton"
|
$button1.Name = "saveButton"
|
||||||
$button1.DialogResult = [System.Windows.Forms.DialogResult]::OK
|
$button1.DialogResult = [System.Windows.Forms.DialogResult]::OK
|
||||||
$button1.UseVisualStyleBackColor = $True
|
$button1.UseVisualStyleBackColor = $True
|
||||||
$button1.Text = "Save"
|
$button1.Text = "Confirm"
|
||||||
$button1.Location = New-Object System.Drawing.Point(27,454)
|
$button1.Location = New-Object System.Drawing.Point(27,454)
|
||||||
$button1.Size = New-Object System.Drawing.Size(75,23)
|
$button1.Size = New-Object System.Drawing.Size(75,23)
|
||||||
$button1.DataBindings.DefaultDataSourceUpdateMode = 0
|
$button1.DataBindings.DefaultDataSourceUpdateMode = 0
|
||||||
@@ -170,8 +184,8 @@ function ShowAppSelectionForm {
|
|||||||
$form.Controls.Add($label)
|
$form.Controls.Add($label)
|
||||||
|
|
||||||
$loadingLabel.Location = New-Object System.Drawing.Point(16,28)
|
$loadingLabel.Location = New-Object System.Drawing.Point(16,28)
|
||||||
$loadingLabel.Size = New-Object System.Drawing.Size(200,418)
|
$loadingLabel.Size = New-Object System.Drawing.Size(300,418)
|
||||||
$loadingLabel.Text = 'Loading...'
|
$loadingLabel.Text = 'Loading apps...'
|
||||||
$loadingLabel.BackColor = "White"
|
$loadingLabel.BackColor = "White"
|
||||||
$loadingLabel.Visible = $false
|
$loadingLabel.Visible = $false
|
||||||
|
|
||||||
@@ -209,16 +223,17 @@ function ShowAppSelectionForm {
|
|||||||
|
|
||||||
|
|
||||||
# Reads list of apps from file and removes them for all user accounts and from the OS image.
|
# Reads list of apps from file and removes them for all user accounts and from the OS image.
|
||||||
function RemoveApps {
|
function RemoveAppsFromFile {
|
||||||
param (
|
param (
|
||||||
$appsFile,
|
$appsFilePath
|
||||||
$message
|
|
||||||
)
|
)
|
||||||
|
|
||||||
Write-Output $message
|
$appsList = @()
|
||||||
|
|
||||||
|
Write-Output "> Removing default selection of apps..."
|
||||||
|
|
||||||
# Get list of apps from file at the path provided, and remove them one by one
|
# Get list of apps from file at the path provided, and remove them one by one
|
||||||
Foreach ($app in (Get-Content -Path $appsFile | Where-Object { $_ -notmatch '^#.*' -and $_ -notmatch '^\s*$' } )) {
|
Foreach ($app in (Get-Content -Path $appsFilePath | Where-Object { $_ -notmatch '^#.*' -and $_ -notmatch '^\s*$' } )) {
|
||||||
# Remove any spaces before and after the Appname
|
# Remove any spaces before and after the Appname
|
||||||
$app = $app.Trim()
|
$app = $app.Trim()
|
||||||
|
|
||||||
@@ -232,21 +247,15 @@ function RemoveApps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$appString = $app.Trim('*')
|
$appString = $app.Trim('*')
|
||||||
Write-Output "Attempting to remove $appString..."
|
$appsList += $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 ""
|
RemoveApps $appsList
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Removes apps specified during function call from all user accounts and from the OS image.
|
# Removes apps specified during function call from all user accounts and from the OS image.
|
||||||
function RemoveSpecificApps {
|
function RemoveApps {
|
||||||
param (
|
param (
|
||||||
$appslist
|
$appslist
|
||||||
)
|
)
|
||||||
@@ -254,13 +263,26 @@ function RemoveSpecificApps {
|
|||||||
Foreach ($app in $appsList) {
|
Foreach ($app in $appsList) {
|
||||||
Write-Output "Attempting to remove $app..."
|
Write-Output "Attempting to remove $app..."
|
||||||
|
|
||||||
$app = '*' + $app + '*'
|
if (($app -eq "Microsoft.OneDrive") -or ($app -eq "Microsoft.Edge")) {
|
||||||
|
# Use winget to remove OneDrive and Edge
|
||||||
|
if ($global:wingetInstalled -eq $false) {
|
||||||
|
Write-Host "WinGet is not installed, app was not removed" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# Uninstall app via winget
|
||||||
|
winget uninstall --accept-source-agreements --id $app
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# Use Remove-AppxPackage to remove all other apps
|
||||||
|
$app = '*' + $app + '*'
|
||||||
|
|
||||||
# Remove installed app for all existing users
|
# Remove installed app for all existing users
|
||||||
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage
|
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers
|
||||||
|
|
||||||
# Remove provisioned app from OS image, so the app won't be installed for any new users
|
# 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 }
|
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,7 +336,7 @@ function ClearStartMenu {
|
|||||||
$startmenuBinFile = $startmenu.Fullname + "\start2.bin"
|
$startmenuBinFile = $startmenu.Fullname + "\start2.bin"
|
||||||
|
|
||||||
# Check if bin file exists
|
# Check if bin file exists
|
||||||
if(Test-Path $startmenuBinFile) {
|
if (Test-Path $startmenuBinFile) {
|
||||||
Copy-Item -Path $startmenuTemplate -Destination $startmenu -Force
|
Copy-Item -Path $startmenuTemplate -Destination $startmenu -Force
|
||||||
|
|
||||||
$cpyMsg = "Replaced start menu for user " + $startmenu.Fullname.Split("\")[2]
|
$cpyMsg = "Replaced start menu for user " + $startmenu.Fullname.Split("\")[2]
|
||||||
@@ -358,18 +380,18 @@ function AddParameter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Create or clear file that stores last used settings
|
# Create or clear file that stores last used settings
|
||||||
if (!(Test-Path "$PSScriptRoot/LastSettings")) {
|
if (!(Test-Path "$PSScriptRoot/SavedSettings")) {
|
||||||
$null = New-Item "$PSScriptRoot/LastSettings"
|
$null = New-Item "$PSScriptRoot/SavedSettings"
|
||||||
}
|
}
|
||||||
elseif ($global:FirstSelection) {
|
elseif ($global:FirstSelection) {
|
||||||
$null = Clear-Content "$PSScriptRoot/LastSettings"
|
$null = Clear-Content "$PSScriptRoot/SavedSettings"
|
||||||
}
|
}
|
||||||
|
|
||||||
$global:FirstSelection = $false
|
$global:FirstSelection = $false
|
||||||
|
|
||||||
# Create entry and add it to the file
|
# Create entry and add it to the file
|
||||||
$entry = $parameterName + "#- " + $message
|
$entry = $parameterName + "#- " + $message
|
||||||
Add-Content -Path "$PSScriptRoot/LastSettings" -Value $entry
|
Add-Content -Path "$PSScriptRoot/SavedSettings" -Value $entry
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -401,6 +423,15 @@ function PrintFromFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Check if winget is installed
|
||||||
|
try {
|
||||||
|
$global:wingetVersion = winget -v
|
||||||
|
$global:wingetInstalled = $true
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
$global:wingetInstalled = $false
|
||||||
|
}
|
||||||
|
|
||||||
# Hide progress bars for app removal, as they block Win11Debloat's output
|
# Hide progress bars for app removal, as they block Win11Debloat's output
|
||||||
$ProgressPreference = 'SilentlyContinue'
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
|
|
||||||
@@ -410,35 +441,48 @@ $SPParams = 'WhatIf', 'Confirm', 'Verbose', 'Silent'
|
|||||||
$SPParamCount = 0
|
$SPParamCount = 0
|
||||||
|
|
||||||
# Count how many SPParams exist within Params
|
# Count how many SPParams exist within Params
|
||||||
|
# This is later used to check if any options were selected
|
||||||
foreach ($Param in $SPParams) {
|
foreach ($Param in $SPParams) {
|
||||||
if ($global:Params.ContainsKey($Param)) {
|
if ($global:Params.ContainsKey($Param)) {
|
||||||
$SPParamCount++
|
$SPParamCount++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove LastSetting file if it's empty
|
# Check if SavedSettings file exists, if it doesn't exist check if LastSettings file exists
|
||||||
if ((Test-Path "$PSScriptRoot/LastSettings") -and ([String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/LastSettings")))) {
|
if (Test-Path "$PSScriptRoot/SavedSettings") {
|
||||||
Remove-Item -Path "$PSScriptRoot/LastSettings" -recurse
|
if ([String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/SavedSettings"))) {
|
||||||
|
# Remove SavedSettings file if it's empty
|
||||||
|
Remove-Item -Path "$PSScriptRoot/SavedSettings" -recurse
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (Test-Path "$PSScriptRoot/LastSettings") {
|
||||||
|
if ([String]::IsNullOrWhiteSpace((Get-content "$PSScriptRoot/LastSettings"))) {
|
||||||
|
# Remove LastSettings file if it's empty
|
||||||
|
Remove-Item -Path "$PSScriptRoot/LastSettings" -recurse
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# Rename LastSettings file to SavedSettings if it isn't empty
|
||||||
|
Rename-Item -Path "$PSScriptRoot/LastSettings" -NewName "$PSScriptRoot/SavedSettings"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Only run the app selection form if the 'RunAppConfigurator' parameter was passed to the script
|
# Only run the app selection form if the 'RunAppConfigurator' parameter was passed to the script
|
||||||
if($RunAppConfigurator) {
|
if ($RunAppConfigurator) {
|
||||||
$result = ShowAppSelectionForm
|
|
||||||
|
|
||||||
PrintHeader "App Configurator"
|
PrintHeader "App Configurator"
|
||||||
|
|
||||||
|
$result = ShowAppSelectionForm
|
||||||
|
|
||||||
# Show different message based on whether the app selection was saved or cancelled
|
# Show different message based on whether the app selection was saved or cancelled
|
||||||
if($result -ne [System.Windows.Forms.DialogResult]::OK) {
|
if ($result -ne [System.Windows.Forms.DialogResult]::OK) {
|
||||||
Write-Host "App configurator was closed without saving." -ForegroundColor Red
|
Write-Host "App configurator was closed without saving." -ForegroundColor Red
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-Output "Your app selection was saved to the 'CustomAppsList' file in the root folder of the script."
|
Write-Output "Your app selection was saved to the 'CustomAppsList' file in the root folder of the script."
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
|
||||||
|
|
||||||
# Suppress prompt if Silent parameter was passed
|
# Suppress prompt if Silent parameter was passed
|
||||||
if (-not $Silent) {
|
if (-not $Silent) {
|
||||||
|
Write-Output ""
|
||||||
Write-Output "Press any key to exit..."
|
Write-Output "Press any key to exit..."
|
||||||
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||||
}
|
}
|
||||||
@@ -455,15 +499,19 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
|
|||||||
else {
|
else {
|
||||||
# Show menu and wait for user input, loops until valid input is provided
|
# Show menu and wait for user input, loops until valid input is provided
|
||||||
Do {
|
Do {
|
||||||
$ModeSelectionMessage = "Please select an option (1/2/0)"
|
$ModeSelectionMessage = "Please select an option (1/2/3/0)"
|
||||||
|
|
||||||
# Get & print script menu from file
|
PrintHeader 'Menu'
|
||||||
PrintFromFile "$PSScriptRoot/Menus/Menu"
|
|
||||||
|
|
||||||
# Only show this option if LastSettings file exists
|
Write-Output "(1) Default Mode: Apply the default settings"
|
||||||
if (Test-Path "$PSScriptRoot/LastSettings") {
|
Write-Output "(2) Custom Mode: Modify the script to your needs"
|
||||||
Write-Output "(3) Run the script with the settings from last time"
|
Write-Output "(3) App removal mode: Select & remove apps, without making other changes"
|
||||||
$ModeSelectionMessage = "Please select an option (1/2/3/0)"
|
|
||||||
|
# Only show this option if SavedSettings file exists
|
||||||
|
if (Test-Path "$PSScriptRoot/SavedSettings") {
|
||||||
|
Write-Output "(4) Apply saved custom settings from last time"
|
||||||
|
|
||||||
|
$ModeSelectionMessage = "Please select an option (1/2/3/4/0)"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
@@ -478,85 +526,37 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
|
|||||||
# Get & print script information from file
|
# Get & print script information from file
|
||||||
PrintFromFile "$PSScriptRoot/Menus/Info"
|
PrintFromFile "$PSScriptRoot/Menus/Info"
|
||||||
|
|
||||||
|
Write-Output ""
|
||||||
Write-Output "Press any key to go back..."
|
Write-Output "Press any key to go back..."
|
||||||
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||||
}
|
}
|
||||||
elseif (-not $Silent -and ($Mode -eq '1')) {
|
elseif (($Mode -eq '4')-and -not (Test-Path "$PSScriptRoot/SavedSettings")) {
|
||||||
# Get & print default settings info from file
|
$Mode = $null;
|
||||||
PrintFromFile "$PSScriptRoot/Menus/DefaultSettings"
|
|
||||||
|
|
||||||
Write-Output "Press enter to execute the script or press CTRL+C to quit..."
|
|
||||||
Read-Host | Out-Null
|
|
||||||
}
|
|
||||||
elseif (($Mode -eq '3')) {
|
|
||||||
if (Test-Path "$PSScriptRoot/LastSettings") {
|
|
||||||
if(-not $Silent) {
|
|
||||||
PrintHeader 'Setup'
|
|
||||||
Write-Output "Win11Debloat will make the following changes:"
|
|
||||||
|
|
||||||
# Get & print default settings info from file
|
|
||||||
Foreach ($line in (Get-Content -Path "$PSScriptRoot/LastSettings" )) {
|
|
||||||
# Remove any spaces before and after the Appname
|
|
||||||
$line = $line.Trim()
|
|
||||||
|
|
||||||
# Check if line has # char, show description, add parameter
|
|
||||||
if (-not ($line.IndexOf('#') -eq -1)) {
|
|
||||||
Write-Output $line.Substring(($line.IndexOf('#') + 1), ($line.Length - $line.IndexOf('#') - 1))
|
|
||||||
$paramName = $line.Substring(0, $line.IndexOf('#'))
|
|
||||||
|
|
||||||
if($paramName -eq "RemoveAppsCustom") {
|
|
||||||
# If paramName is RemoveAppsCustom, check if CustomAppsFile exists
|
|
||||||
if(Test-Path "$PSScriptRoot/CustomAppsList") {
|
|
||||||
# Apps file exists, print list of apps
|
|
||||||
$appsList = @()
|
|
||||||
|
|
||||||
# Get apps list from file
|
|
||||||
Foreach ($app in (Get-Content -Path "$PSScriptRoot/CustomAppsList" )) {
|
|
||||||
# Remove any spaces before and after the app name
|
|
||||||
$app = $app.Trim()
|
|
||||||
|
|
||||||
$appsList += $app
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host $appsList -ForegroundColor DarkGray
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
# Apps file does not exist, print error and continue to next item
|
|
||||||
Write-Host "Could not load custom apps list from file, no apps will be removed!" -ForegroundColor Red
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(-not $global:Params.ContainsKey($ParameterName)){
|
|
||||||
$global:Params.Add($paramName, $true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Output ""
|
|
||||||
Write-Output "Press enter to execute the script or press CTRL+C to quit..."
|
|
||||||
Read-Host | Out-Null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$Mode = $null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while ($Mode -ne '1' -and $Mode -ne '2' -and $Mode -ne '3')
|
while ($Mode -ne '1' -and $Mode -ne '2' -and $Mode -ne '3' -and $Mode -ne '4')
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add execution parameters based on the mode
|
# Add execution parameters based on the mode
|
||||||
switch ($Mode) {
|
switch ($Mode) {
|
||||||
# Default mode, no user input required, all (relevant) options are added
|
# Default mode, loads defaults after confirmation
|
||||||
'1' {
|
'1' {
|
||||||
|
# Print the default settings & require userconfirmation, unless Silent parameter was passed
|
||||||
|
if (-not $Silent) {
|
||||||
|
PrintFromFile "$PSScriptRoot/Menus/DefaultSettings"
|
||||||
|
|
||||||
|
Write-Output ""
|
||||||
|
Write-Output "Press enter to execute the script or press CTRL+C to quit..."
|
||||||
|
Read-Host | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
$DefaultParameterNames = 'RemoveApps','DisableTelemetry','DisableBing','DisableLockscreenTips','DisableSuggestions','ShowKnownFileExt','DisableWidgets','HideChat','DisableCopilot'
|
$DefaultParameterNames = 'RemoveApps','DisableTelemetry','DisableBing','DisableLockscreenTips','DisableSuggestions','ShowKnownFileExt','DisableWidgets','HideChat','DisableCopilot'
|
||||||
|
|
||||||
PrintHeader 'Default Configuration'
|
PrintHeader 'Default Mode'
|
||||||
|
|
||||||
# Add default parameters if they don't already exist
|
# Add default parameters if they don't already exist
|
||||||
foreach ($ParameterName in $DefaultParameterNames) {
|
foreach ($ParameterName in $DefaultParameterNames) {
|
||||||
if(-not $global:Params.ContainsKey($ParameterName)){
|
if (-not $global:Params.ContainsKey($ParameterName)){
|
||||||
$global:Params.Add($ParameterName, $true)
|
$global:Params.Add($ParameterName, $true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -567,12 +567,12 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Custom mode, add options based on user input
|
# Custom mode, show & add options based on user input
|
||||||
'2' {
|
'2' {
|
||||||
# Get current Windows build version to compare against features
|
# Get current Windows build version to compare against features
|
||||||
$WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild
|
$WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild
|
||||||
|
|
||||||
PrintHeader 'Custom Configuration'
|
PrintHeader 'Custom Mode'
|
||||||
|
|
||||||
# Show options for removing apps, only continue on valid input
|
# Show options for removing apps, only continue on valid input
|
||||||
Do {
|
Do {
|
||||||
@@ -587,7 +587,7 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
|
|||||||
if ($RemoveCommAppInput -eq '3') {
|
if ($RemoveCommAppInput -eq '3') {
|
||||||
$result = ShowAppSelectionForm
|
$result = ShowAppSelectionForm
|
||||||
|
|
||||||
if($result -ne [System.Windows.Forms.DialogResult]::OK) {
|
if ($result -ne [System.Windows.Forms.DialogResult]::OK) {
|
||||||
# User cancelled or closed app selection, show error and change RemoveCommAppInput so the menu will be shown again
|
# User cancelled or closed app selection, show error and change RemoveCommAppInput so the menu will be shown again
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
Write-Host "Cancelled application selection, please try again" -ForegroundColor Red
|
Write-Host "Cancelled application selection, please try again" -ForegroundColor Red
|
||||||
@@ -613,7 +613,7 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
|
|||||||
AddParameter 'RemoveGamingApps' 'Remove the Xbox App and Xbox Gamebar'
|
AddParameter 'RemoveGamingApps' 'Remove the Xbox App and Xbox Gamebar'
|
||||||
}
|
}
|
||||||
'3' {
|
'3' {
|
||||||
Write-Output "$($global:SelectedApps.Count) apps have been selected for removal"
|
Write-Output "You have selected $($global:SelectedApps.Count) apps for removal"
|
||||||
|
|
||||||
AddParameter 'RemoveAppsCustom' "Remove $($global:SelectedApps.Count) apps:"
|
AddParameter 'RemoveAppsCustom' "Remove $($global:SelectedApps.Count) apps:"
|
||||||
}
|
}
|
||||||
@@ -809,17 +809,90 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
|
|||||||
Read-Host | Out-Null
|
Read-Host | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintHeader 'Custom Configuration'
|
PrintHeader 'Custom Mode'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run with options from last time, loaded from 'LastSettings' file
|
# App removal, remove apps based on user selection
|
||||||
'3' {
|
'3' {
|
||||||
PrintHeader 'Custom Configuration'
|
PrintHeader "App Removal"
|
||||||
|
|
||||||
|
$result = ShowAppSelectionForm
|
||||||
|
|
||||||
|
if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
|
||||||
|
Write-Output "You have selected $($global:SelectedApps.Count) apps for removal"
|
||||||
|
AddParameter 'RemoveAppsCustom' "Remove $($global:SelectedApps.Count) apps:"
|
||||||
|
|
||||||
|
# Suppress prompt if Silent parameter was passed
|
||||||
|
if (-not $Silent) {
|
||||||
|
Write-Output ""
|
||||||
|
Write-Output "Press enter to remove the selected apps or press CTRL+C to quit..."
|
||||||
|
Read-Host | Out-Null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Host "Selection was cancelled, no apps have been removed!" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Output ""
|
||||||
|
}
|
||||||
|
|
||||||
|
# Load custom options selection from the "SavedSettings" file
|
||||||
|
'4' {
|
||||||
|
if (-not $Silent) {
|
||||||
|
PrintHeader 'Custom Mode'
|
||||||
|
Write-Output "Win11Debloat will make the following changes:"
|
||||||
|
|
||||||
|
# Get & print default settings info from file
|
||||||
|
Foreach ($line in (Get-Content -Path "$PSScriptRoot/SavedSettings" )) {
|
||||||
|
# Remove any spaces before and after the Appname
|
||||||
|
$line = $line.Trim()
|
||||||
|
|
||||||
|
# Check if line has # char, show description, add parameter
|
||||||
|
if (-not ($line.IndexOf('#') -eq -1)) {
|
||||||
|
Write-Output $line.Substring(($line.IndexOf('#') + 1), ($line.Length - $line.IndexOf('#') - 1))
|
||||||
|
$paramName = $line.Substring(0, $line.IndexOf('#'))
|
||||||
|
|
||||||
|
if ($paramName -eq "RemoveAppsCustom") {
|
||||||
|
# If paramName is RemoveAppsCustom, check if CustomAppsFile exists
|
||||||
|
if (Test-Path "$PSScriptRoot/CustomAppsList") {
|
||||||
|
# Apps file exists, print list of apps
|
||||||
|
$appsList = @()
|
||||||
|
|
||||||
|
# Get apps list from file
|
||||||
|
Foreach ($app in (Get-Content -Path "$PSScriptRoot/CustomAppsList" )) {
|
||||||
|
# Remove any spaces before and after the app name
|
||||||
|
$app = $app.Trim()
|
||||||
|
|
||||||
|
$appsList += $app
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host $appsList -ForegroundColor DarkGray
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# Apps file does not exist, print error and continue to next item
|
||||||
|
Write-Host "Could not load custom apps list from file, no apps will be removed!" -ForegroundColor Red
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not $global:Params.ContainsKey($ParameterName)){
|
||||||
|
$global:Params.Add($paramName, $true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Output ""
|
||||||
|
Write-Output ""
|
||||||
|
Write-Output "Press enter to execute the script or press CTRL+C to quit..."
|
||||||
|
Read-Host | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
|
PrintHeader 'Custom Mode'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PrintHeader 'Custom Configuration'
|
PrintHeader 'Custom Mode'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -829,7 +902,7 @@ if ($SPParamCount -eq $global:Params.Keys.Count) {
|
|||||||
Write-Output "The script completed without making any changes."
|
Write-Output "The script completed without making any changes."
|
||||||
|
|
||||||
# Suppress prompt if Silent parameter was passed
|
# Suppress prompt if Silent parameter was passed
|
||||||
if(-not $Silent) {
|
if (-not $Silent) {
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
Write-Output "Press any key to exit..."
|
Write-Output "Press any key to exit..."
|
||||||
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||||
@@ -839,7 +912,7 @@ else {
|
|||||||
# Execute all selected/provided parameters
|
# Execute all selected/provided parameters
|
||||||
switch ($global:Params.Keys) {
|
switch ($global:Params.Keys) {
|
||||||
'RemoveApps' {
|
'RemoveApps' {
|
||||||
RemoveApps "$PSScriptRoot/Appslist.txt" "> Removing pre-installed Windows bloatware..."
|
RemoveAppsFromFile "$PSScriptRoot/Appslist.txt"
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'RemoveAppsCustom' {
|
'RemoveAppsCustom' {
|
||||||
@@ -855,7 +928,7 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Write-Output "> Removing $($appsList.Count) apps..."
|
Write-Output "> Removing $($appsList.Count) apps..."
|
||||||
RemoveSpecificApps $appsList
|
RemoveApps $appsList
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-Host "> Could not load custom apps list from file, no apps were removed!" -ForegroundColor Red
|
Write-Host "> Could not load custom apps list from file, no apps were removed!" -ForegroundColor Red
|
||||||
@@ -868,7 +941,7 @@ else {
|
|||||||
Write-Output "> Removing Mail, Calendar and People apps..."
|
Write-Output "> Removing Mail, Calendar and People apps..."
|
||||||
|
|
||||||
$appsList = 'Microsoft.windowscommunicationsapps', 'Microsoft.People'
|
$appsList = 'Microsoft.windowscommunicationsapps', 'Microsoft.People'
|
||||||
RemoveSpecificApps $appsList
|
RemoveApps $appsList
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
continue
|
continue
|
||||||
@@ -877,7 +950,7 @@ else {
|
|||||||
Write-Output "> Removing new Outlook for Windows app..."
|
Write-Output "> Removing new Outlook for Windows app..."
|
||||||
|
|
||||||
$appsList = 'Microsoft.OutlookForWindows'
|
$appsList = 'Microsoft.OutlookForWindows'
|
||||||
RemoveSpecificApps $appsList
|
RemoveApps $appsList
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
continue
|
continue
|
||||||
@@ -886,7 +959,7 @@ else {
|
|||||||
Write-Output "> Removing developer-related related apps..."
|
Write-Output "> Removing developer-related related apps..."
|
||||||
|
|
||||||
$appsList = 'Microsoft.PowerAutomateDesktop', 'Microsoft.RemoteDesktop', 'Windows.DevHome'
|
$appsList = 'Microsoft.PowerAutomateDesktop', 'Microsoft.RemoteDesktop', 'Windows.DevHome'
|
||||||
RemoveSpecificApps $appsList
|
RemoveApps $appsList
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
@@ -896,7 +969,7 @@ else {
|
|||||||
Write-Output "> Removing gaming related apps..."
|
Write-Output "> Removing gaming related apps..."
|
||||||
|
|
||||||
$appsList = 'Microsoft.GamingApp', 'Microsoft.XboxGameOverlay', 'Microsoft.XboxGamingOverlay'
|
$appsList = 'Microsoft.GamingApp', 'Microsoft.XboxGameOverlay', 'Microsoft.XboxGamingOverlay'
|
||||||
RemoveSpecificApps $appsList
|
RemoveApps $appsList
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
@@ -915,7 +988,7 @@ else {
|
|||||||
|
|
||||||
# Also remove the app package for bing search
|
# Also remove the app package for bing search
|
||||||
$appsList = 'Microsoft.BingSearch'
|
$appsList = 'Microsoft.BingSearch'
|
||||||
RemoveSpecificApps $appsList
|
RemoveApps $appsList
|
||||||
|
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user