0
有沒有辦法將開關操作符傳遞到爲執行腳本而創建的powershell提示符。基本上我有一個執行PowerShell腳本的狀態文件:SaltStack在窗口上執行unsigned 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旁路-File
任何方式設置executionpolicy標誌在狀態文件本身?
謝謝!
它看起來像當前的開發分支(見https://開頭github.com/saltstack/salt/blob/develop/salt/modules/cmdmod.py)在運行powershell腳本時設置'-ExecutionPolicy bypass'選項,所以你可以嘗試使用它。 – Lee
謝謝李!我會嘗試今天更新到2014.1.0 – balwa