Removing Windows 10 bloat with powershell ?

Associate
Joined
5 Jul 2007
Posts
510
The windows 10 faq above contains the following yet is missing some unwanted apps that have installed with my win10....

"Remove Lot's of the Bloatware / Spyware, Run In power shell as ADMIN

Get-AppxPackage -AllUsers -Name Microsoft.3DBuilder | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.Getstarted | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.MicrosoftOfficeHub | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.MicrosoftSolitaireCollection | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.SkypeApp | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.WindowsMaps | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.BingWeather | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.Office.OneNote | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.XboxApp | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.ZuneMusic | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.ZuneVideo | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.BingSports | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.BingNews | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.WindowsPhone | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.BingFinance | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.WindowsSoundRecorder | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.Windows.Photos | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.WindowsCamera | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.WindowsAlarms | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.People | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name Microsoft.MicrosoftEdge | Remove-AppxPackage"

What line do I need to enter to properly remove "Your Phone", "X Box Game Bar", Windows Store", "Connect" and "Messaging" ?. Quality answers only please !

Looking around the internet I find several different quotes/formats !?, for example....
Get-AppxPackage *windowsstore* | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.WindowsStore" | Remove-AppxPackage

I also notice that after removing apps using powershell, re listing the apps via powershell still shows those you removed yet they DO vanish from the start button ?. That seems to imply the packages are NOT being uninstalled !

Thanks in advance
 
Last edited:
If you want to get rid of as many of the metro apps as you can, these two commands should help you greatly:
Code:
Get-AppxPackage -AllUsers | Remove-AppxPackage
Get-AppXProvisionedPackage -online | Remove-AppxProvisionedPackage -online
 
I also notice that after removing apps using powershell, re listing the apps via powershell still shows those you removed yet they DO vanish from the start button ?. That seems to imply the packages are NOT being uninstalled !

Thanks in advance

This only removes the apps from the current mounted image, which means the next time you get a feature update, they'll be back, or can easily be re-installed by PoSH. What you want to do is remove the apps from an unmounted image (iso) and then use that to build your Win10USB image.

I'm not sure why it's really in the FAQ as it's a bit naff. It literally just hides the apps.
 
This only removes the apps from the current mounted image, which means the next time you get a feature update, they'll be back, or can easily be re-installed by PoSH. What you want to do is remove the apps from an unmounted image (iso) and then use that to build your Win10USB image.

I'm not sure why it's really in the FAQ as it's a bit naff. It literally just hides the apps.

Darn....
 
This only removes the apps from the current mounted image, which means the next time you get a feature update, they'll be back, or can easily be re-installed by PoSH. What you want to do is remove the apps from an unmounted image (iso) and then use that to build your Win10USB image.

I'm not sure why it's really in the FAQ as it's a bit naff. It literally just hides the apps.
The first tool that springs to mind and that I use, is MSMG ToolKit. Unfortunately I am not allowed to link to the site that discusses the development of this tool, so you'll have to Google it. As long as you pay attention to the ReadMe file, you will be fine.
 

I've tweaked some PoSH so you can do this now, for all users, for ever, from the WIM. It requires you have to access to a Win10 source media.

1. Create a folder on your current machine (for example C:\Mounted)
2. Extract the Win10 media (assuming your media is D:\ at a cmd or run prompt type xcopy D:\*.* /s /e /f C:\Mounted)
3. Save the code below as removeapps.ps1
4. Open PoSH as Administrator
5. Browse to where you saved removeapps.ps1 and type:
Code:
removeapps.ps1 -pathtowim C:\Mounted\Sources\install.wim -selectapps $true
6. This will open a console window and allow you to select each app you want to keep or remove. Additionally, in removeapps.ps1 you can whitelist apps, and choose -selectapps $false. It will then remove all apps except those in the whitelist. If you have a large Enterprise WIM, with multiple Win10 versions, I have added a WIM index parameter too, but this shouldn't be needed for home/pro users.



Code:
## Save me as removeapps.ps1 ##

param (
    [string]$pathtowim,
    [string]$selectapps,
    [string]$index="1"
    )

$Host.UI.RawUI.BackgroundColor = "Black"; Clear-Host
$startdate = (Get-Date).ToString()
$ProgressPreference=’SilentlyContinue’

$WhiteListedApps = @(
    "Microsoft.StorePurchaseApp"
    "Microsoft.WindowsCalculator", 
    "Microsoft.WindowsStore"
)

function CreateTempDirectory {
   $tmpDir = [System.IO.Path]::GetTempPath()
   $tmpDir = [System.IO.Path]::Combine($tmpDir, [System.IO.Path]::GetRandomFileName())
   [System.IO.Directory]::CreateDirectory($tmpDir) | Out-Null
   $tmpDir
   }
try {
    $pathworkfolder = CreateTempDirectory
    Write-Host "Start:" $startdate -ForegroundColor White
    Write-Host "Create temporary directory..." -ForegroundColor Green
    Write-Host "Temporary directory:" $pathworkfolder -ForegroundColor Green
    }

catch [Exception] {
    Write-Host "Error:" $_.Exception.Message -ForegroundColor Red; break
    }

try {
    Write-Host "Mounting Windows-Image..." $pathtowim -ForegroundColor Green
    Write-Host "Please wait..." -ForegroundColor White
    Mount-WindowsImage -Path $pathworkfolder -ImagePath $pathtowim -Index $index | Out-Null
    }

catch [Exception] {
    Write-Host "Mounting Windows-Image failed..." -ForegroundColor Red;
    Write-Host "Error:" $_.Exception.Message -ForegroundColor Red; break
    }
try {
    Write-Host "Remove the following Built-in apps:" -ForegroundColor Green 
    $apps = Get-AppxProvisionedPackage -Path $pathworkfolder  | ForEach-Object {

 if (($_.DisplayName -notin $WhiteListedApps)) {

    if($selectapps -eq $true) {
    $call = read-host "Do you really want to delete the following App:" $_.DisplayName "(Y/N)"

 if($call -eq "y") {
    Write-Host "Delete:" $_.DisplayName -ForegroundColor Green
    Remove-AppxProvisionedPackage -Path $pathworkfolder -PackageName $_.PackageName
    $call = ""
    }

 else {
    Write-Host "Skipped:" $_.DisplayName -ForegroundColor yellow
    }
    }

    else {
    Write-Host "Delete:" $_.DisplayName -ForegroundColor Green
    Remove-AppxProvisionedPackage -Path $pathworkfolder -PackageName $_.PackageName 
    $call = ""
    }

    }

    }
    }

catch [Exception] {
    Write-Host "Removing Built-in apps failed..." -ForegroundColor Red;
    Write-Host "Error:" $_.Exception.Message -ForegroundColor Red; break
    }

try {
    Write-Host "Dismount-WindowsImage..." -ForegroundColor Green
    Write-Host "Please wait..." -ForegroundColor White
    Dismount-WindowsImage -Path $pathworkfolder  -Save -CheckIntegrity | Out-Null
    Write-Host "Remove temporary directory..." -ForegroundColor Green
    Remove-Item $pathworkfolder -Recurse -Force | Out-Null
    Write-Host "Complete:" (Get-Date).ToString() -ForegroundColor White
    }

catch [Exception] {
    Write-Host "Error:" $_.Exception.Message -ForegroundColor Red; break
    }

After you've completed that step, move the install.wim back from C:\Mounted to your USB stick, replacing the install.wim that's there.
 
@Django x2
Good effort, but I had to allow unsigned scripts to run this script and then had to adjust your command as below to launch it:
Code:
.\removeapps.ps1 -pathtowim C:\Mounted\Sources\install.wim -selectapps $true

Have yet to install Windows 10 from this trial, but I do believe it is a little more involved than you realise. Hence why people such as MSMG need to tweak their ToolKit every major Windows 10 release.
 
@Django x2
Good effort, but I had to allow unsigned scripts to run this script and then had to adjust your command as below to launch it:
Code:
.\removeapps.ps1 -pathtowim C:\Mounted\Sources\install.wim -selectapps $true

Have yet to install Windows 10 from this trial, but I do believe it is a little more involved than you realise. Hence why people such as MSMG need to tweak their ToolKit every major Windows 10 release.

Nope, it works just fine and there are no UWP apps present and they don't come back. Sorry for the command, I assumed people used the tab button these days :D

The *only* downside I've seen is that it leaves a stubb to menu items where the start menu expects to see the app (you'll get a weird P~2323432234 tile instead), but that doesn't bother me as I swap out my layout.xml before logging in anyway for a custom start menu.

Worth noting too, that, as for now, 1903 was the last big kernel update (not change since 1607) so feature updates from 1903 are small tweaks rather than large overhauls.
 
If I remember rightly this one removes everything other than whats specified, I use it on MDT Deployments but its been a while and cant remember the finer details -

Set-ExecutionPolicy Unrestricted
Get-AppxPackage -AllUsers | where-object {$_.name -notlike "*Microsoft.WindowsStore*"} | where-object {$_.name -notlike "*Microsoft.WindowsCalculator*"} | where-object {$_.name -notlike "*Microsoft.Windows.Photos*"} | Remove-AppxPackage
Get-AppxProvisionedPackage -online | where-object {$_.packagename -notlike "*Microsoft.WindowsStore*"} | where-object {$_.packagename -notlike "*Microsoft.WindowsCalculator*"} | where-object {$_.packagename -notlike "*Microsoft.Windows.Photos*"} |Remove-AppxProvisionedPackage -online
 
If I remember rightly this one removes everything other than whats specified, I use it on MDT Deployments but its been a while and cant remember the finer details -

Set-ExecutionPolicy Unrestricted
Get-AppxPackage -AllUsers | where-object {$_.name -notlike "*Microsoft.WindowsStore*"} | where-object {$_.name -notlike "*Microsoft.WindowsCalculator*"} | where-object {$_.name -notlike "*Microsoft.Windows.Photos*"} | Remove-AppxPackage
Get-AppxProvisionedPackage -online | where-object {$_.packagename -notlike "*Microsoft.WindowsStore*"} | where-object {$_.packagename -notlike "*Microsoft.WindowsCalculator*"} | where-object {$_.packagename -notlike "*Microsoft.Windows.Photos*"} |Remove-AppxProvisionedPackage -online

This will only work until a feature upgrade is released. It doesn't actually remove the apps from the image.
 
This will only work until a feature upgrade is released. It doesn't actually remove the apps from the image.

Seems to be ok on 1809 and 1909 but yes I do recall it being version specific now that you mention it

Maybe the source has updated it, Deployment Ninja rings a bell, might be wrong though. Sorry if its good but thought it worth mentioning
 
Seems to be ok on 1809 and 1909 but yes I do recall it being version specific now that you mention it

Maybe the source has updated it, Deployment Ninja rings a bell, might be wrong though. Sorry if its good but thought it worth mentioning

It's possible, since 1809 that this will now stick as that was the last large feature upgrade MS promised (pinch of salt). I prefer to make it stick with whatever new WIM I am using rolled up with the latest CU
 
I will be getting a new NVME SSD 1TB in the next week or so.

What would be the best way to remove all the bloat from Windows 10 before doing this?

I have downloaded the ISO and extracted it to a folder using the W10 media creation tool.

This gives me a install.esd, I am using Windows 10 Pro
 
Last edited:
I will be getting a new NVME SSD 1TB in the next week or so.

What would be the best way to remove all the bloat from Windows 10 before doing this?

I have downloaded the ISO and extracted it to a folder using the W10 media creation tool.

This gives me a install.esd, I am using Windows 10 Pro
I would opt for using MSMG ToolKit. You've plenty of time to explore the menus and see which options suit you - be sure to test in a VM where possible.
 
I think some of the installs are unique and they have ID's different from PC to PC. There is a command that you can run to get all apps installed and it should be in that list somewhere as mentioned in post #2

Code:
Get-AppxPackage -AllUsers
 
I would opt for using MSMG ToolKit. You've plenty of time to explore the menus and see which options suit you - be sure to test in a VM where possible.
I have been trying this but when removing certain apps I get errors appear and when I recreate the ISO file and try in a VM windows doesnt work very well
 
For me it's a placebo, but I feel happier when I've got rid of all the stuff I'll never use or need :) For performance, probably makes no difference.

Does it save on space much? I can agree it would be great to get rid of cortana, Microsoft store, etc as if I wanted to use it I'd go out my way to install rather than being left with it always there.
 
Back
Top Bottom