Hi there,
Currently trying to attach NFS datastores to a freshly installed ESXi host using the following foreach statement below:
foreach ($Datastore in (Get-vmhost source-esx.domain.com | Get-Datastore | where {$_.Type -eq "nfs" -and $_.Accessible -eq "true"})) {New-Datastore -Nfs -VMHost dest-esx.domain.com -Name $Datastore.Name -Path $Datastore.RemotePath -NfsHost $Datastore.RemoteHost}
The command failes with "Value cannot be found for the mandatory parameter VMHost" within the "New-Datastore" portion of the command. Running PowerCLI 5.5 R1 Build 1295336.
Any suggestions on how to get around this error would be much appreciated!
~Pete