r/PowerShell • • Jan 14 '26

Export-ProvisioningPackage

Why doesn't this work?

Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -eq "MicrosoftTeams"} | Export-ProvisioningPackage -OutputFolder "c:\microsoftteams"

0 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/GMMitenka Jan 18 '26

Does that mean you can't remove it from a custom image deployment of windows to prevent the appx from being deployed in the first place or ever?

1

u/CurtisInTheClouds Jan 19 '26

You can still strip classic provisioned Appx packages out of an offline image with Remove-AppxProvisionedPackage, and Microsoft still says that is the right way to stop those apps from installing for new users (possibly out of date not sure how often they attend to their docs). The problem is that Windows 11 changed how certain inbox apps work, it looks like Teams especially isn’t just a provisioned Appx anymore. It can come back through the Store, OOBE, or other system components, so removing it from the image alone doesn’t guarantee it stays gone. For those newer apps, you usually need to pair image cleanup with policy or management controls if you want the removal to actually stick.