Hi,
I'm looking for a way to register a VM with a specific folder.
"New-VM -Location $folder"
But it's working only if one folder existing with that name. I did a function to get the full path but it doesn't seem to accept it.
So i tried with "Move-VM" after the registration but it doesn't work neither.
New-vm or Move-Vm can accept fullpath folder or idfolder ?
Kind Regards
You can do:
New-VM -VMFilePath "[$datastore] $vmname/$vmname.vmx" -Location (Get-folder -Id $folderID)
Hi,vXav
I'm not sure to follow you, for my example :
"New-VM -VMFilePath "[$datastore] $vmname/$vmname.vmx" -Location $folder"
If i don't put a simple name in $folder, my command doesn't work. I tried with a fullpath and folder id.
And like you guess, several folders have the same name.