Get-WmiObject -class Win32_InstalledStoreProgram
Answers (1)
Is the package you're trying to query listed when you run get-appx package? I would try to avoid get-wmiobject or wmic.exe whenever possible as Microsoft has discussed plans to remove them in the near future
As far as getting a specific property as a return from a command, you'd want to look at the property names (likely name and version) and then add | select-object - property name, version ... Etc Above example would pull both the name and version property.Select-object -property version.. would display only the version. And so on
Also, usually not all properties are automatically displayed when you run a command you can often pipe the command to | fl .. to see all properties associated with an object.
I.e. get-appxpackage | fl ,Would show you all possible properties and their values. From that return you can find which properties you want to cherry pick using select-object -property
You can also specify a command return as a variable.
(The code for this might not be fully accurate as on mobile)
But something along the lines of the following should work
$productversion=(Get-WmiObject -class Win32_InstalledStoreProgram | Where-Object name -eq Microsoft.VP9VideoExtension)
And you could then call $productversion.version
$productversion=(Get-WmiObject -class Win32_InstalledStoreProgram | Where-Object name -eq Microsoft.VP9VideoExtension).version
To get the value directly as a variable