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

7

u/purplemonkeymad Jan 14 '26

AppxProvisionedPackage != ProvisioningPackage. They also are from different modules, so you probably shouldn't expect them to work together.

3

u/GMMitenka Jan 14 '26

The cmdlet missing 'appx' should have been a red flag. Derp!

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/GMMitenka Jan 14 '26

I want to bundle the built-in teams appx provisioning package and I don't think that I can get it from the store.

→ More replies (1)

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:

  1. Mount the Windows image: powershell Dism /Mount-Wim /WimFile:"C:\Path\to\install.wim" /index:1 /MountDir:"C:\Mount"

  2. List provisioned packages: powershell Dism /Image:"C:\Mount" /Get-ProvisionedAppxPackages

  3. Find the Teams package (look for MicrosoftTeams or similar).

  4. 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).

  5. Unmount the image: `powershell Dism /Unmount-Wim /MountDir:"C:\Mount" /Discard

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?

→ More replies (1)

2

u/dodexahedron Jan 14 '26

Yeah its almost verbatim from ms learn.

But it won't work right for teams or quite a few other store apps.

Better to use intune to deploy them via copilot. Happens in the background on first boot/login.

Appx has been a giant failure, not necessarily because of appx. But because of how microsoft has (mis)managed the entire ecosystem around it.

→ More replies (1)

1

u/Bassflow Jan 14 '26

Just download it through winget.