PHP调用powershell指令执行不成功 echo shell_exec('powershell echo yy'); // 会输出yy但是如果使用file参数就不行 echo shell_exec('powershell -file test.ps1'); // 输出空 // test.ps1中内容为
echo yy------------------------------------------各位求助~~powershellphp
echo yy------------------------------------------各位求助~~powershellphp
test.ps1与这个php文件在同一个目录 难道还要写上绝对路径?我try try
powershell中加上-executionpolicy unrestricted就可以了powershell -executionpolicy unrestricted -file test.ps1