I'm getting the error "Connect-VIServer : Invalid URI: The hostname could not be parsed" when I try to connect to vCenter servers whose names are defined in a variable.
However, when I list them directly in the command I'm able to connect to them, and there's no error.
I'd love to know what am I doing wrong.
Thanks
Your variable is interpreted as 1 string, not as an array of strings.
This should work
$vc = 'vc1','vc2'
Connect-VIServer -Server $vc
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Your variable is interpreted as 1 string, not as an array of strings.
This should work
$vc = 'vc1','vc2'
Connect-VIServer -Server $vc
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
And indeed it works.
Thanks a lot for the quick response and for the great explanation.