Now when we have the Store issue solved, I just realized an issue about PowerShell (in general).
Here are the inputs and outputs I am looking at:
Test 1
Code:
Input 1
foreach ($location in (Get-AppxPackage *WindowsStore* -AllUsers).InstallLocation) {Write-Host $location\AppXManifest.xml}
Output 1
C:\Program Files\WindowsApps\Microsoft.WindowsStore_11802.1001.3.0_x64__8wekyb3d8bbwe\AppXManifest.xml
Test 2
Code:
Input 2
foreach ($location in (Get-AppxPackage *WindowsStore* -AllUsers)) {Write-Host $location.InstallLocation\AppXManifest.xml}
Output 2
C:\Program Files\WindowsApps\Microsoft.WindowsStore_11802.1001.3.0_x64__8wekyb3d8bbwe \AppXManifest.xml
Test 3
Code:
Input 3
foreach ($location in (Get-AppxPackage *WindowsStore* -AllUsers)) {Write-Host "$($location.InstallLocation)\AppXManifest.xml"}
Output 3
C:\Program Files\WindowsApps\Microsoft.WindowsStore_11802.1001.3.0_x64__8wekyb3d8bbwe\AppXManifest.xml
Why do I get an extra space in example 2? Only thing I did was, I moved the .InstallLocation to be extracted from $location variable instead of straight from the first command. Why does adding "$(blah blah)" solve this issue? What is that extra character? it certainly is NOT a space/whitespace since .Trim() does nothing to it.
No wonder .Net and PS produce errors if one has to deal with such weird behavior.