VMware Cloud Community
VirExprt
Expert
Expert

ABX editor does not recognize PowerCLI Commandlets

Hi, i am running vRA 8.5 and trying to create an ABX action using Powershell which will basically connect to the vCenter server and run some commands on the target VM. While i am trying to debug it, I am consistently getting an error which makes me wonder if the ABX editor supports PowerCLI cmdlets which is very likely to be true.

here is the command which i am trying to run

VirExprt_0-1631911394310.png

here is the error which i am getting 

 

"Cannot validate argument on parameter 'Server'. The argument is null, empty, or an element of the argument collection contains a null value. Supply a collection that does not contain any null values and then try the command again. at Handler, /function/client_main.psm1: line 34 at applyFunction, /function/abx_wrapper.ps1: line 442 at <ScriptBlock>, /function/abx_wrapper.ps1: line 473 "

 

any idea what is going on?

Regards, MG
0 Kudos
1 Reply
caduncan
Enthusiast
Enthusiast

Check the connect-viserver syntax. I think you are missing the -Server switch.

I use:

Connect-VIServer -Server $vchost -User $vcuser -Password $vcword -force

 

Also, I recommend closing the connection at the end of your script:  Disconnect-VIServer -Server $vchost -Confirm:$false

Finally, you may have to increase the 'Memory limit (MB)' in the ABX properties. I found myself running out of memory. I set it to the limit of 3008, but test to see what works best for you.