Accessing environment variables in PowerShell is easy, either:
to view all of them, or:
to access a specific one. However, if you try that for the ProgramFiles(x86) environment variable you are greeted with the following error:view sourceprint?
x86 : The term
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.
There are a few ways around this: