Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过jmeter/BSF采样器/beanshell挂起运行时的powershell/powershell_Powershell_Jmeter_Powercli - Fatal编程技术网

通过jmeter/BSF采样器/beanshell挂起运行时的powershell/powershell

通过jmeter/BSF采样器/beanshell挂起运行时的powershell/powershell,powershell,jmeter,powercli,Powershell,Jmeter,Powercli,我希望有人遇到了这个问题,可以给我一些建议,下一步该怎么做 我正在尝试在jmeter中运行一些powercli脚本(在powershell中运行)。 我正在使用比恩希尔的jmeter中的BSF采样器 我正在使用以下脚本: exec("powershell.exe -PSConsoleFile "C:\Program Files\VMware\InfrastructurVSphere PowerCLI\vim.psc1" - command .\CoreApplAdmin.ps1"); 测试运

我希望有人遇到了这个问题,可以给我一些建议,下一步该怎么做

我正在尝试在jmeter中运行一些powercli脚本(在powershell中运行)。 我正在使用比恩希尔的jmeter中的BSF采样器

我正在使用以下脚本:

exec("powershell.exe -PSConsoleFile "C:\Program Files\VMware\InfrastructurVSphere PowerCLI\vim.psc1"
 - command .\CoreApplAdmin.ps1");
测试运行(我在屏幕上看到测试的输出),但运行后测试不会返回。基本上是挂着的。我不得不杀了杰米特。我在jmeter日志中没有看到任何内容


有什么想法吗?非常感谢您提供的任何信息/建议。

使用Os Process sampler,它更符合您的要求


听起来有点类似于通过PsExec调用powershell.exe时,它只是挂起在最后。您可以从这里尝试相同的解决方法:基本上,使用类似于
cmd.exe/c“echo.|powershell.exe-psconsolefile'blahblah'-command.\coreappadmin.ps1“
谢谢您的回答。我试过你的建议。。。现在它不再挂了。。但是,jmeter结果文件不显示任何内容。通常,当测试运行成功时,结果文件应该显示(即rc=ok,等等)谢谢你的回复。我确实试过了,但不知何故我没能成功。在本例中,它显示:CMD/C DIR C:/DIR。。CMD之后的/C的用途是什么。。。在这种情况下/C标识要运行的shell cmd。但在您的情况下,它将是powershell.exe…,每个单词都是parameter.powershell.exe-PSConsoleFile“C:\Program Files\VMware\InfrastructurevSphere PowerCLI\vim.psc1”-command.\coreappadmin.ps1以下是我真正想说的:我使用OS_进程采样器尝试了以下操作:command:cmd参数1:/C参数2:powershell.exe参数3:-psc参数4:“C:\Program Files\VMware\InfrastructurevSphere PowerCLI\vim.psc1”参数5:-command参数6:。\coreappadmin.ps1。当我运行测试时,jmeter似乎挂起了。。。我尝试将“C:\Program Files\…\vim.psc1”-命令。\coreAppadmin.ps1”组合为一个参数,但也失败了(它没有挂起,但也没有运行)。有什么想法可以试试吗?