By the way, I am getting the same error message about Get-AppXPackage in the latest version of PowerShell, which is Version 7.
The ancient version 1 should be on your machine. If you open File Explorer and navigate to: C:\Windows\System32\WindowsPowerShell\v1.0
you can then right click on the powershell.exe that's there and choose Run As Administrator. Get-AppXPackage should function then. Remember to use the command:
Get-AppXPackage *WindowsStore* -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
which is what was given way back when by
@xrobwx71.
I have on idea why Get-AppXPackage is being so cranky in other versions of PowerShell.