Hi. :)
A thought:
The above error is common when you run the command from an elevated command prompt instead of PowerShell.
To make sure that you are in Powershell, write Powershell in the Search area, and then right click the item in the list to run it as administrator. It's a blue window, not black.
OK, so I had a misunderstanding, mistook command prompt for PowerShell.
Now I tried PowerShell in Admin mode.
Below a copy of the red text that appeared after pasting in the lines you suggested:
Get-Process : A positional parameter cannot be found that accepts argument 'Get-AppXPackage'.
At line:1 char:1
+ PS C:\Users\Joy> Get-AppXPackage *WindowsStore* -AllUsers | Foreach { ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-Process], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetProcessCommand
PS C:\WINDOWS\system32> Get-AppXPackage : Access is denied.
Get-AppxPackage : A positional parameter cannot be found that accepts argument 'is'.
At line:1 char:1
+ Get-AppXPackage : Access is denied.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AppxPackage], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.Windows.Appx.PackageManager.Commands.GetAppxPackag
eCommand
PS C:\WINDOWS\system32> Access is denied.
Access : The term 'Access' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Access is denied.
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (Access:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I am not sure which one to use, coz three powershell entries show up in the search
Powershell
Powershell x 86
Powershell ISE