SOLVED

Get-AppXPackage, Dependencies, and Impersonation

MVP

This was driving me nuts for two weeks until I found the source of this error.

 

I have a MSIX Package.  I also have a modification package that contains a plugin, and that modification package AppXManifest lists dependency on that package (a plugin).

 

I manually install the package and the plugin package while logged in as a user. 

 

From that user account I run the Get-AppXPackage command.  The returned list contains a direct entry for the main package but not the modification package.  I'm OK with that because the modification package IS listed under the "Dependencies" property array of the main package.  

 

I have a background process running under the local system account.  This process then impersonates the user and runs the same PowerShell query.  The main package is listed, however the modification package is NOT listed under the "Dependencies" property array.

 

It appears that there is no way for this background process to know whether or not the modification package is deployed.

 

So how would, let's say Config Manager or Intune (or my code) know not to install the modification package every time evaluation is run?  Smells like a bug to me.

 

 

3 Replies
best response confirmed by John Vintzel (Microsoft)
Solution

@TIMOTHY MANGAN 

 

You can see modification packages using: Get-AppPackage -PackageTypeFilter Optional

 

ConfigMgr and Intune leverage an inbox CSP for manageability.  They have a few different pivots to get the installed app inventory as well.  The APIs also allow for this filtering.

 

John

@John Vintzel 

I tested the PackageTypeFilter option with impersonation to be sure it works, and it does. 

 

But that is a workaround something that is a bug. It doesn't make sense that a request made without a PackageTypeFilter doesn't populate the dependencies like the same non-impersonated request.

 

So instead of one query I have to make one for main packages, one for optional (manually filtering out the main package that also shows up), and one for framework. Very stupid.

@TIMOTHY MANGAN 

 

Thank you for your feedback.  Unfortunately this is something we are unlikely to service in in market OSes and hopefully the options, albeit "very stupid" will help enable the scenario you are looking to achieve.

 

John.

 

 

1 best response

Accepted Solutions
best response confirmed by John Vintzel (Microsoft)
Solution

@TIMOTHY MANGAN 

 

You can see modification packages using: Get-AppPackage -PackageTypeFilter Optional

 

ConfigMgr and Intune leverage an inbox CSP for manageability.  They have a few different pivots to get the installed app inventory as well.  The APIs also allow for this filtering.

 

John

View solution in original post