| Name | Description | Required? | Pipeline Input | Default Value |
|---|
| Server | Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. | false | false | |
| VMHost | Specify a host where you want to create the new datastore. | true | true (ByValue) | |
| Name | Specify a name for the new datastore. | true | false | |
| Path | If you want to create a local datastore, specify the file path to the directory where the virtual machine data is stored.
If you want to create a NFS/CIFS datastore, specify the remote path of the NFS mount point.
If you want to create a VMFS datastore, specify the canonical name of the SCSI logical unit that will contain new VMFS datastores. | true | false | |
| NfsHost | Specify the NFS host where you want to create the new datastore. | true | false | |
| ReadOnly | Indicate that the access mode for the mount point is ReadOnly. The default access mode is ReadWrite. | false | false | |
| Cifs | Indicate that you want to create a CIFS datastore. | false | false | |
| Username | Specify the username you want to use for authentication with the CIFS server. | true | false | |
| Password | Specify the password you want to use for authentication with the CIFS server. | true | false | |
| WhatIf | Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | false | |
| Confirm | If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation. | false | false | $true |
| Local | Indicate that you want to create a Local datastore. | false | false | |
| Nfs | Indicate that you want to create a NFS datastore. | false | false | |
| Vmfs | Indicate that you want to create a VMFS datastore. | false | false | |
| BlockSizeMB | Specify the maximum file size of VMFS in megabytes (MB). If no value is given, the maximum file size for the current system platform is used. | false | false | |
-------------- Example 1 --------------
New-Datastore -Nfs -VMHost 10.23.112.345 -Name Datastore -Path $remotePath -NfsHost $remoteHost
Creates a new Nfs datastore named Datastore on the virtual machine host with IP address 10.23.112.345 with the specified parameters.
-------------- Example 2 --------------
Get-VMHost | New-Datastore -Nfs -Name NFS1 -Path "/mnt/nfs1/nfs11/test1" -NfsHost 10.91.246.21
Adds a NFS storage across multiple hosts.