有没有办法将开关运算符传递给为执行脚本而创建的 powershell 提示符。基本上我有一个执行powershell脚本的状态文件:
function1:
cmd.script:
- source: salt://utils/scripts/function1.ps1
- shell: "powershell"
- env: "-ExecutionPolicy bypass"
但这不起作用。
因为一个肮脏的解决方案是通过cmd运行脚本:%windir%\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -executionpolicy Bypass -File
有什么方法可以在状态文件本身中设置执行策略标志?
谢谢!