Hey all,
just upgraded to vSphere 6 and ran into some problems with the following setup:
vCenter: 6.0
vRO: 6.0.1
PowerCLI on PowerShell Host: 6.0
When deploying VMs a workflow is called to Set some vSphere Tags with a powershell script through the remote Powershell host.
It was working fine before the upgrade and also works fine when I run the script locally on the powershell host.
But when I run it through the "Invoke an external script" or "Invoke a PowerShell script" workflow from Library -> PowerShell, it either just reports "null" or ends in an error
I slimmed the script down as much as possile and still get the error with this little script:
Add-PsSnapin VMware.VimAutomation.Core -ea "SilentlyContinue" Connect-VIServer vcenter.server -User user-Password 'supersecretpw' Get-Tag -Category Organisationseinheit -Name ZE-RZ Disconnect-VIServer vcenter.server -Confirm:$false Exit 0
It still produces the following error:
PowerShellInvocationError: Errors found while executing script VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.VimException: 23.04.2015 14:19:14 Get-Tag Value cannot be null. Parameter name: collection ---> System.ArgumentNullException: Value cannot be null. Parameter name: collection at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) at VMware.VimAutomation.ViCore.Impl.V1.Service.ViCoreObjectInteropCoreServiceProviderImpl.GetObn(IList`1 connectionIdList, IList`1 objectNameList, IList`1 objectInterfaceTypeList, IList`1 contextList) at VMware.VimAutomation.Sdk.Impl.V1.CoreServiceImpl.GetObn(IList`1 connectionIdList, IList`1 objectNameList, IList`1 objectInterfaceTypeList, IList`1 contextList, String contextRelationName) at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ObnSelector.GetObjectsByNameCore(PropertyInfo parameter, String objectName) at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ObnSelector.SelectObjectByNameCore(PropertyInfo parameter, String objectName) at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ObnSelector.SelectObjectByName(PropertyInfo parameter) at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ObnSelector.SelectObjectsByName() at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.BaseCmdlet.ProcessRecordErrorHandled() at VMware.VimAutomation.ViCore.Util10Ps.BaseCmdlet.BaseCmdlet.ProcessRecordErrorHandled() --- End of inner exception stack trace --- at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord) (Dynamic Script Module name : invokeScript#14)
Any idea?
Best Regards
Tim