Hi, PowerShell newbie here, I need PowerShell scripting code that returns me the install location of an Appx package on my Windows 10 system. Let's say I get something like this returned by Get-AppxPackage -Name "Microsoft.AsyncTextService" -AllUsers:
Name : Microsoft.AsyncTextService
Publisher : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture : Neutral
ResourceId :
Version : 10.0.19041.1023
PackageFullName : Microsoft.AsyncTextService_10.0.19041.1023_neutral__8wekyb3d8bbwe
InstallLocation : C:\Windows\SystemApps\Microsoft.AsyncTextService_8wekyb3d8bbwe
IsFramework : False
PackageFamilyName : Microsoft.AsyncTextService_8wekyb3d8bbwe
PublisherId : 8wekyb3d8bbwe
PackageUserInformation : {S-1-5-21-2697059947-1034656983-1047649410-1001 [Admin]: Installed, S-1-5-21-2697059947-1034656983-1047649410-1003 [User 1]: Installed}
IsResourcePackage : False
IsBundle : False
IsDevelopmentMode : False
NonRemovable : True
IsPartiallyStaged : False
SignatureKind : System
Status : Ok
In this example, what I need is some PowerShell code that assigns me the string, "C:\Windows\SystemApps\Microsoft.AsyncTextService_8wekyb3d8bbwe", to some variable - so that I can use it elsewhere in my PowerShell script. I experimented with piping into 'Select-String -Pattern "C:\\\Program"' and similar things but that never seemed to work. Somehow I never got the expected string returned from such pattern matching attempts.