It doesn't look like there is a way to import a vm from a datastore by pointing at its .vmx file? Can I do it with new-vm? I didn't see an option for this within the R-CLI either....
Anyone?Folders have a RegisterVM_Task method that should work.
Try something like this:
$folder = get-folder vm
$folderView = get-view $folder.ID
$pool = get-resourcepool resources
$poolView = get-id $pool.ID
$folderView.RegisterVM_Task("/path/to/vm", "VM Name", $false, $poolView.MoRef, $null)
You'll have to play around with the first argument. In case you didn't guess I didn't actually test this :smileyhappy: