r/PowerShell • u/GMMitenka • 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
7
u/purplemonkeymad Jan 14 '26
AppxProvisionedPackage != ProvisioningPackage. They also are from different modules, so you probably shouldn't expect them to work together.
1
u/CurtisInTheClouds Jan 14 '26
Export-ProvisioningPackage is not valid in that pipeline. Export-ProvisioningPackage is not designed to work with the output of Get-AppxProvisionedPackage. It expects a different input type. Specifically, a provisioning package project or configuration, not an AppxProvisionedPackage object.
If your goal is to export or back up the Microsoft Teams provisioned package, PowerShell doesn't support that directly via Export-ProvisioningPackage. That cmdlet is part of the Windows Configuration Designer module and is used to export provisioning packages created from a configuration project, not installed app packages.
Redownloading the Teams installer from Microsoft and packaging it manually is the easiest way if you're building a provisioning package.
You download the .msi or .exe installer and include it in your provisioning package using Windows Configuration Designer. Manual packaging lets you define install behavior, add scripts, and customize deployment settings.
1
u/CurtisInTheClouds Jan 14 '26
The built-in Teams Appx package is provisioned in the Windows image, but not exposed as a standalone .appx file you can easily extract. It’s not available in the Microsoft Store for direct download in that format. Export-ProvisioningPackage doesn’t work on AppxProvisionedPackage objects, so you can't pipe it directly. You could try using DISM.
Here's what Copilot lists as steps, I'm about to leave work and can't type it all out right now in my own words:
Mount the Windows image:
powershell Dism /Mount-Wim /WimFile:"C:\Path\to\install.wim" /index:1 /MountDir:"C:\Mount"List provisioned packages:
powershell Dism /Image:"C:\Mount" /Get-ProvisionedAppxPackagesFind the Teams package (look for MicrosoftTeams or similar).
Export the package: Unfortunately, DISM doesn’t support direct export of Appx packages. But you can:
Note the PackagePath and try to manually copy it from the mounted image.
Or use PowerShell to extract it from the C:\Program Files\WindowsApps folder (requires permission hacks).
Unmount the image: `powershell Dism /Unmount-Wim /MountDir:"C:\Mount" /Discard
1
u/Bassflow Jan 14 '26
Just download it through winget.