2

I'm trying to write a powershell script where

A- Try to install the package from the Path.

B- If the package is already installed, try to uninstall the old version

C- ReTry Step A.

To do the step B, I've tried to get AppxPackageManifest with

$Manifests = Get-AppxPackageManifest -Package $DeveloperPackagePath.Name

(where DeveloperPackagePath is the full path to the package file.)

Because I need the Identity information to remove the application.

But $Manifests is empty.

Path is valid, and App package is valid too.

Is there a way to get the Identity information with the path to the package?

신한슬
  • 189
  • 12

1 Answers1

1

From what I see in the MS docs the cmdlet that gets the manifests works only for installed packages, not for their source.

What you want can be done, but you need to work more the get the identity. First you need to use makeappx.exe to extract the package in a temporary location and then you can parse the XML file to get the identiy.

Bogdan Mitrache
  • 10,536
  • 19
  • 34
  • I've actually managed to do a workaround, I've extracted the .xml file from the .appx and read the identity info. (deleted it at the end of the script) Anyway, thank you for your answer. – 신한슬 Nov 13 '19 at 15:11