Just so you know, the cluster part does not work at all. I tried to fix that for hours.
I import them with the corrected Get-VIPath of course.
The function Get-VILocation retuns an error (once again, the Get-Folder part). The Get-Folder tries to retrive a folder named like my Datacenter. So, it fails and my Location os $null
The calcul of VIPath for my clusters is :
Name VIPath
-------- ----------
Cluster1 DC1
Cluster2 DC1
Cluster3 DC1/Folder
Cluster4 DC2
Note, the cluster 3 has been created successfully, the only one which is not at te root of a datacenter but in a folder. And I understand why this one is created but not others. What I do not know, if Get-VILocation is incorrect, but it worked to create Datacenters and Folders.
It's OK because I can crate all my cluster at the root, then move them manually, but it is frustrating to not understand.