TAG | virtual center
If you only use the command GET-VM, you will receive back the VMs List only from the Virtucal Center that you last connect on. If you want the get all the VM from your both virutal centers, you absolutely need to add the parameter -server $vcs to you command.
If you want to connect to more than one virtual center at the same time, here the starting code :
$vcs = @()
$vcs += connect-viserver vc1.mydom.local
$vcs += connect-viserver vc2.mydom.local
# You could add many as you need...
# Command example
get-vm -server $vcs | export-csv C:\Export.csv
In a general way, don’t forget to add -server $vcs to every command than you use with the VI Toolkit.
As always, RTM -> the documentation on VI Toolkit :