So you created a new NFS datastore and you want to mount it to all the hosts in your vCenter or cluster. You’re really dreading clicking through each host and doing “Add Storage” for every one.
PowerCLI to the rescue! This one-liner will add your new datastore in a snap! Just modify it with details specific to your environment.
[code lang=”powershell”]Get-VMHost | New-Datastore -Nfs -Name "Name Here" ‘-Path "/path/path-here" -NfsHost 0.0.0.0[/code]