Reputation: 1721
I'm trying to replicate the functionality of the Get-AppxPackage and Get-ProvisionedAppxPackage Powershell cmdlets for a C# application I'm building, but have no idea how to even get started.
I can't use the C# Powershell API because of this problem, so I'd like a native C# solution if possible.
Upvotes: 3
Views: 3375
Reputation: 1721
For what it's worth, I did find a way to get this information directly from WMI: There's a WMI class called Win32_InstalledStoreProgram that returns the desired information
Upvotes: 2
Reputation: 21899
You can use the Windows.Management.Deployement.PackageManager to find, remove, install, etc. packages from code rather than from PowerShell.
The Enumerate app packages sample demonstrates how to use this from C# and C++.
Upvotes: 4