Raphire / Win11Debloat

A simple, easy to use PowerShell script to remove pre-installed apps from Windows, disable telemetry, remove Bing from Windows search as well as perform various other changes to declutter and improve your Windows experience. This script works for both Windows 10 and Windows 11.
MIT License
12.88k stars 546 forks source link

Option to remove individual pinned apps from the startmenu (ie. Grammarly and Spotify) #41

Open projektilski opened 6 months ago

projektilski commented 6 months ago

Hi, can you implement an option to remove Grammarly and Spotify?

Raphire commented 6 months ago

Heya,

Could you confirm that they're actually installed on the system? My guess is that they're just pinned to the start menu, and will not be installed until you click them. Similar to your other issue #40.

projektilski commented 6 months ago

They are not installed, but the uninstall option is available when right click on them. Grammaryl, Spotify, and LinkedIn are spamming the Start Menu on a brand new profile.

EDIT: Spotify is installed and exe is located in the AppData folder, it offers an uninstall option. LinkedIn was downloading something when clicked but it did not open, uninstall was available. Grammary does not offer an uninstall option and points to Microsoft Store.

Raphire commented 6 months ago

It's interesting that the behaviour is so different between the 3 apps.

Could you confirm if they're actually recognized as installed and removable by running the following commands in powershell:

Spotify: Get-AppxPackage *spotify*

This is what I get after installing spotify: image

LinkedIn: Get-AppxPackage *linkedin*

This is what I get after installing linkedin: image

Grammarly: winget list grammarly

This is what I get after installing grammarly image

Raphire commented 6 months ago

I have done some additional testing by doing a few fresh installs. In those installs Grammarly, LinkedIn, Spotify, and Luminar Neo do show up in the start menu, but none are installed. I also couldn't find any files related to Spotify, or any of the other 3 apps.

projektilski commented 6 months ago

Hi, I did some testing also. If I understand correctly, your script removes apps for all users. When I create a new user on the same machine, all those apps are listed in Start Menu, but are not actually installed. Right click on them offers uninstall option, but what it actually does is to remove the pinned item.
So the real issue is how to remove those unwanted pinned items for new users.

p.s. I found a new app Journal which is not pinned in Start Menu but it is listed under All apps. It can be uninstalled via Powershell using Microsoft.MicrosoftJournal manifes name.

Raphire commented 6 months ago

Hi, I did some testing also. If I understand correctly, your script removes apps for all users. When I create a new user on the same machine, all those apps are listed in Start Menu, but are not actually installed. Right click on them offers uninstall option, but what it actually does is to remove the pinned item. So the real issue is how to remove those unwanted pinned items for new users.

Exactly right, the UI does act as if they are installed (as they show an uninstall option), but they're not.

The annoying part is that these app links are, at least for a script like this, much harder to remove than the actual apps if they were installed. I'm looking into ways to have this script be able to unpin individual apps, but right now the only way I have found that works is replacing the whole start menu layout all together.

p.s. I found a new app Journal which is not pinned in Start Menu but it is listed under All apps. It can be uninstalled via Powershell using Microsoft.MicrosoftJournal manifes name.

I'll be adding support for this app to the script, thanks for bringing that to my attention 😀

Raphire commented 6 months ago

I've renamed the issue (and definitely didn't make a spelling mistake) to better reflect the feature requested.

miladhatami1393 commented 4 months ago

Hi, I did some testing also. If I understand correctly, your script removes apps for all users. When I create a new user on the same machine, all those apps are listed in Start Menu, but are not actually installed. Right click on them offers uninstall option, but what it actually does is to remove the pinned item. So the real issue is how to remove those unwanted pinned items for new users.

p.s. I found a new app Journal which is not pinned in Start Menu but it is listed under All apps. It can be uninstalled via Powershell using Microsoft.MicrosoftJournal manifes

Raphire commented 4 months ago

Hi, I did some testing also. If I understand correctly, your script removes apps for all users. When I create a new user on the same machine, all those apps are listed in Start Menu, but are not actually installed. Right click on them offers uninstall option, but what it actually does is to remove the pinned item. So the real issue is how to remove those unwanted pinned items for new users.

That's correct, the items are not installed so they cannot be removed. They only exist as a pinned item in the start menu binary. This binary (start2.bin) is stored per user at: C:\Users\{USERNAME}\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState

As the file is a binary it cannot be edited easily. That's why Win11Debloat can only clear the entire start menu by replacing this file with another.

p.s. I found a new app Journal which is not pinned in Start Menu but it is listed under All apps. It can be uninstalled via Powershell using Microsoft.MicrosoftJournal manifes

Win11Debloat should be able to uninstall this already. It's actually marked to be uninstalled as part of the default setting.

sean-sauve commented 1 month ago

@Raphire Instead of using start2.bin from another user, you could use Export-StartLayout and Import-StartLayout. That would make it easier for people to review and change over a bin file.

https://learn.microsoft.com/en-us/powershell/module/startlayout/import-startlayout

https://learn.microsoft.com/en-us/windows/configuration/start/layout?tabs=intune-10%2Cintune-11&pivots=windows-11

You could also have a "remove" function that exports the current start menu, opens the json and removes the lines for Spotify and saves it, and then imports the modified layout. Cost/benefit might be low on building that, but by working with structured data that Posh can understand it opens up more possibilities. These json files are also how Intune works to apply start menu configs, so you'd be in good company.

Raphire commented 1 month ago

@Raphire Instead of using start2.bin from another user, you could use Export-StartLayout and Import-StartLayout. That would make it easier for people to review and change over a bin file.

https://learn.microsoft.com/en-us/powershell/module/startlayout/import-startlayout

https://learn.microsoft.com/en-us/windows/configuration/start/layout?tabs=intune-10%2Cintune-11&pivots=windows-11

You could also have a "remove" function that exports the current start menu, opens the json and removes the lines for Spotify and saves it, and then imports the modified layout. Cost/benefit might be low on building that, but by working with structured data that Posh can understand it opens up more possibilities. These json files are also how Intune works to apply start menu configs, so you'd be in good company.

Unfortunately I don't think the Import-StartLayout cmdlet works for Windows 11.

It seems that for Windows 11 the layout you get from the Export-StartLayout cmdlet can only be applied by supported tools like InTune using policies. Even if I was able to do the same with the script, it would lead to a bad user experience, because according to the page you linked this would mean the start menu layout cannot be changed anymore by the user, quote:

Users can change the order of the pinned elements, pin, or unpin items. When a user signs in again, the Start layout specified in the policy setting is reapplied, without retaining any user changes.

If there is a different way to apply a Start layout I'd be happy to implement it into the script.

sean-sauve commented 1 month ago

Good point, I didn't know this didn't work for Windows 11 sorry.

Raphire commented 1 month ago

Good point, I didn't know this didn't work for Windows 11 sorry.

No worries! I appreciate you taking the time to look into this issue, it's just a shame Microsoft locked simple stuff like this down.