您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

调用powershell不成功

2024/2/27 19:38:59发布16次查看
powershell php
php调用powershell指令执行不成功
echo shell_exec('powershell echo yy'); // 会输出yy
但是如果使用file参数就不行
echo shell_exec('powershell -file test.ps1'); // 输出空
// test.ps1中内容为
    echo yy
------------------------------------------
各位求助~~
回复讨论(解决方案) 路径都没问题么?
路径都没问题么?
test.ps1与这个php文件在同一个目录 难道还要写上绝对路径?我try try
路径都没问题么?
powershell中加上-executionpolicy unrestricted就可以了
powershell -executionpolicy unrestricted -file test.ps1
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product