${env:ProgramFiles(x86)} Powershell 变量在 32 位/x86 系统上包含什么? [英] What does the ${env:ProgramFiles(x86)} Powershell variable contain on a 32bit/x86 system?
问题描述
简单的问题:
如果我在 32 位系统上的 PowerShell 脚本中使用 ${env:ProgramFiles(x86)} 变量,它会返回C:\Program Files"还是未定义?
If I use the ${env:ProgramFiles(x86)} variable in a PowerShell script on a 32-bit system does it return "C:\Program Files" or is it undefined?
在 x64 系统上,在 x64 和 x86 模式下运行时,它将被映射到C:\Program Files (x86)".我没有要测试的 32 位系统,但我希望它将它映射到C:\Program Files"文件夹,以便我可以使用它来引用任何系统上的 x86 程序.
On a x64 system it will be mapped to "C:\Program Files (x86)" when running in both x64 and x86 mode. I don't have a 32bit system to test on, but I hope that it will be mapped to the "C:\Program Files" folder so I can use it to refer to x86 programs on any system.
推荐答案
${env:ProgramFiles(x86)}
未在 32 位计算机上定义.您可以针对 $null
进行测试以验证这一点.
${env:ProgramFiles(x86)}
is not defined on a 32-bit machine. You can test against $null
to verify that.
这篇关于${env:ProgramFiles(x86)} Powershell 变量在 32 位/x86 系统上包含什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!