Hello,
I am trying to use PowerCLI to add a VM to inventory. I know the exact location and I'm not having any issues seeing the file, I have verified the location using ls:
ls vmstores:\srmvc2.MYDOMAIN.ca@443\DR\NASG_SVM1_ESX_Templates\PICOB_NEW1\PICOB_NEW1.vmx
Datastore path: [NASG_SVM1_ESX_Templates] PICOB_NEW1
LastWriteTime Type Length Name
------------- ---- ------ ----
2016/04/18 11:35 AM VmConfigFile 3554 PICOB_NEW1.vmx
This result seems to indicate the path to the vmx file is correct, I attempt to add the file to inventory using the following command:
New-VM -VMHost srmesxi62.MYDOMAIN.ca -Location Migrating -VMFilePath "vmstores:\srmvc2.MYDOMAIN.ca@443\DR\NASG_SVM1_ESX_Templates\PICOB_NEW1\PICOB_NEW1.vmx"
This returns an invalid path error. This must be dead simple to fix, but I can't see where I'm going wrong. Any ideas?
Your path formatting is incorrect, try this:
New-VM -VMHost srmesxi62.MYDOMAIN.ca -Location Migrating -VMFilePath "[NASG_SVM1_ESX_Templates] PICOB_NEW1/PICOB_NEW1.vmx"
Your path formatting is incorrect, try this:
New-VM -VMHost srmesxi62.MYDOMAIN.ca -Location Migrating -VMFilePath "[NASG_SVM1_ESX_Templates] PICOB_NEW1/PICOB_NEW1.vmx"
Awesome, thanks!