【发布时间】:2021-06-26 03:56:03
【问题描述】:
我正在从批处理脚本运行 powershell。这是示例代码。
powershell.exe Set-ExecutionPolicy Bypass -Force
set logDir=C:\testfolder\
mkdir %logDir%
powershell.exe C:\<folder>\test.ps1 >> "%logDir%test.log"
出现错误:“test.ps1”未被识别为 cmdlet 的名称 此问题仅发生在特定 VM 上。在其他 Windows 机器上完成相同的脚本执行。 需要解决这个问题。
【问题讨论】:
标签: windows powershell batch-file policy cmdlet