cschneegans / unattend-generator

.NET Core library to create highly customized autounattend.xml files
https://schneegans.de/windows/unattend-generator/
MIT License
659 stars 60 forks source link

Remove bloatware Windows 11 24H2 #66

Open fm1985 opened 1 month ago

fm1985 commented 1 month ago

When installing Windows 11 24H2, the "Remove bloatware" process is completely ignored. Despite my attempts to remove specific apps, they are still fully installed on the system. I am using the official ISO from Microsoft (Win11_24H2_German_x64.iso).

The applications listed in the script are still fully installed after the Windows setup is completed.

Have I made a mistake somewhere?

<File path="C:\Windows\Temp\remove-packages.ps1"> $selectors = @( 'Microsoft.Microsoft3DViewer'; 'Microsoft.BingSearch'; 'Microsoft.549981C3F5F10'; 'MicrosoftCorporationII.MicrosoftFamily'; 'Microsoft.Getstarted'; 'microsoft.windowscommunicationsapps'; 'Microsoft.WindowsMaps'; 'Microsoft.BingNews'; 'Microsoft.MicrosoftOfficeHub'; 'Microsoft.OutlookForWindows'; 'Microsoft.People'; 'Microsoft.SkypeApp'; 'Microsoft.MicrosoftSolitaireCollection'; 'MicrosoftTeams'; 'MSTeams'; 'Microsoft.BingWeather'; 'Microsoft.Xbox.TCUI'; 'Microsoft.XboxApp'; 'Microsoft.XboxGameOverlay'; 'Microsoft.XboxGamingOverlay'; 'Microsoft.XboxIdentityProvider'; 'Microsoft.XboxSpeechToTextOverlay'; 'Microsoft.GamingApp'; 'Microsoft.ZuneVideo'; ); $getCommand = { Get-AppxProvisionedPackage -Online; }; $filterCommand = { $_.DisplayName -eq $selector; }; $removeCommand = { [CmdletBinding()] param( [Parameter(Mandatory, ValueFromPipeline)] $InputObject ); process { $InputObject | Remove-AppxProvisionedPackage -AllUsers -Online -ErrorAction 'Continue'; } }; $type = 'Package'; $logfile = 'C:\Windows\Temp\remove-packages.log'; & { $installed = & $getCommand; foreach($selector in $selectors) { $result = [ordered] @{ Selector = $selector; }; $found = $installed | Where-Object -FilterScript $filterCommand; if($found) { $result.Output = $found | & $removeCommand; if($?) { $result.Message = "$type removed."; } else { $result.Message = "$type not removed."; $result.Error = $Error[0]; } } else { $result.Message = "$type not installed."; } $result | ConvertTo-Json -Depth 3 -Compress; } } *> &>> $logfile; </File>

edcarreiro commented 1 month ago

Ssme for Brazilian Portuguese iso. Everything goes smoothly, LESS bloatware.

cschneegans commented 1 month ago

When installing Windows 11 24H2, the "Remove bloatware" process is completely ignored.

Cannot reproduce, i.e. bloatware removal works reliably with both Win11_24H2_English_x64.iso and Win11_24H2_German_x64.iso.

If you wonder about application pins in the start menu, this might be because you chose Use default pins. Use Remove all pins instead:

heXMl0oQnxkYBBEL

Otherwise, run this command in an elevated PowerShell session and post the results here:

Get-Content -Path C:\windows\Temp\remove-packages.log | ConvertFrom-Json | Format-Table -AutoSize

Hammerfest commented 1 month ago

No mistake, I mentioned this in a ticket a while ago and it has been mentioned a few times in tickets by others.

I can find no rhyme or reason why this does not work sometimes but does other. I thought it was due to how quickly I was going through setup, but sometimes it does, sometimes it doesn't. I also have no remove-packages.log while all other changes made from the unattended work, check if you have it, if you do post as requested, if not, make mention of.

@fm1985 you doing this install on a bare metal system or on a VM, if in a VM which one?

stimpy81 commented 1 month ago

I do wonder if some systems are too fast for everything to be processed properly... It's odd that sometimes everything installs and is set correctly, then another time some random thing isn't working.

I think this new 24H2 setup might be the culprit. But this is only a guess.