3
votes

I am hoping someone has ran into this problem and may give me some tips on what to try next.

I am trying to run some powercli scripts (ran in powershell) in jmeter. I am using the BSF sampler in jmeter using beanshell

I am using this script:

exec("powershell.exe -PSConsoleFile "C:\Program Files\VMware\InfrastructurVSphere PowerCLI\vim.psc1"
 - command .\CoreApplAdmin.ps1");

The test runs (I see the output of the test in the screen) but the test does not return after running. Basically, it's hung. I had to kill jmeter. I dont see anything in the jmeter logs.

Any ideas? Thanks much for any info/suggestions.

1
Sounds kind of similar to when one invokes powershell.exe via PsExec - it just hangs at the end. You can try the same workaround from here: leeholmes.com/blog/2007/10/02/… Bascially, use something like cmd.exe /c "echo . | powershell.exe -psconsolefile 'blahblah' -command .\CoreApplAdmin.ps1" - latkin
Thank you for the answer. I tried your suggestion ... and now it does not hang anymore! .. However, jmeter result file does not show anything. Normally, when the testrun is successful, the result file should show that (ie. rc=ok, etc). - Glenda Boja
Well, I'm afraid I can't help with that part, never used jmeter before ;-) - latkin

1 Answers