Hi @all
I'm using orchestrator for a few weeks now. All works well up to now.
I want to receive some informations about a process with a pid (in my example 2566).
As written in the documentation this should work. But I think the orchestrator doesn't recognize the long type.
Are there any ideas how to resolve this?
I'm using Orchestrator on Windows Server (5.5 U1a).
Script:
var host = vm.sdkConnection;
var guestOperationsManager = host.guestOperationsManager;
var guestAuth = new VcNamePasswordAuthentication();
guestAuth.username = vmUsername;
guestAuth.password = vmPassword;
var processManager = guestOperationsManager.processManager;
var guestProcessInfo = processManager.listProcessesInGuest(vm , guestAuth , pid);
____
Error:
Cannot convert 2566 to long[] (Workflow:Get process from guest / Scriptable task (item1)#8)
Thanks
To pass the pid as an array instead of a single value, just change the last line of your script
from:
var guestProcessInfo = processManager.listProcessesInGuest(vm , guestAuth , pid);
to:
var guestProcessInfo = processManager.listProcessesInGuest(vm , guestAuth , [pid]);
Notice the brackets around the pid parameter - this is the Javascript way to treat a single value as an array.
moved to Orchestrator communities
As far as I see processManager.listProcessesInGuest(vm , guestAuth , pid); is expecting as third parameter array of longs and not a single pid.
>
pids* | number [] | If set, only return information about the specified processes. Otherwise, information about all processes are returned. If a specified processes does not exist, nothing will be returned for that process. |
Can you try providing array of pid's.
From provided script I am unable to see how pid variable gets initialized. Is it script input parameter. In tis case what type it is?
To pass the pid as an array instead of a single value, just change the last line of your script
from:
var guestProcessInfo = processManager.listProcessesInGuest(vm , guestAuth , pid);
to:
var guestProcessInfo = processManager.listProcessesInGuest(vm , guestAuth , [pid]);
Notice the brackets around the pid parameter - this is the Javascript way to treat a single value as an array.