Can you post the script you are using?
$string = {xpath:{/workflow/inputs/VM/clientName}}
$string = $string -replace('\[','')
$string = $string -replace('\]','')
$string = $string -replace(' ','')
#$input=$input -replace('[','')
$Servers =$string.Split(",")
$plainText = "dumypassword"
$secureString = ConvertTo-SecureString $plainText -AsPlainText -Force
cd 'E:\CV_Scripts\VSA_Adhoc_Backup\CVPowershellSDK-master'
$Jobs = @()
Connect-CVServer -Server server1 -User testuser -Password $secureString
$(foreach ($i in $Servers)
{
$Job = $null
$Vm = Get-CVVirtualMachine -Name $($i)
$pseudoClient = (get-cvclient -id $Vm.pseudoClient.clientId).get_Item("clientName")
$backupJob = Backup-CVVirtualMachine -Name $Vm.client.clientName -ClientName $pseudoClient
$Job = PSCustomObject]@{
VMName = $Vm.Name
JobId = $backupJob.jobIds
}
$Jobs += $Job
})
$Jobs
From what we are seeing the SDK calls are working but they are not able to find the client, hence the error message here:
Get-CVClient: client not found having id [0]
Is is possible to validate that the client information is properly getting into the script?
The same script is working if I use it directly from powershell but for some reason not working when I use it through workflow. How to validate if the client information is properly getting into script in workflow? Is there something we are missing on the script whi h needs to be added in the script in order to use it in workflow
Is there a way to log or write to a file the client information that get client id is trying to look up?