我正在计划一个powershell脚本在服务器上运行。我使用了$env:PSModulePath,其中一个powershell位置是c:\windows\system32\windowsPowerShell\v1.0\Modules。当我查找该位置时,那里没有powershell.exe。我想用它作为系统调度程序中的应用程序名称。如何验证Powershell.exe是否存在?我还想找到上面使用$env命令看到的所有powershell版本的每个版本,以验证哪个版本是我在计算机上测试的5.1版本。
env:PSModulePath
c:windowssystem32windowsPowerShellv1.0Modules
是模块目录
$psHome
返回.exe位置