Datastore Category
Cmdlets are usually implemented around resource operations. The four basic operations are CREATE, READ, UPDATE and DELETE. This set of operations is known as CRUD. Most of the cmdlets support CRUD which are respectively cmdlets that start with the New/Get/Set/Remove cmdlet verbs but they also may have additional operations
Step 1: Retrieve a object by running a Get command
# Retrieves datastores from the VMHost1 and VMHost2 hosts.
Get-VMHost -Name VMHost1, VMHost2 | Get-Datastore
Step 2 : Run commands from the CRUD group
# Creates a VMFS datastore by specifying the file system type.
New-Datastore -VMHost $vmhost -Name Datastore -Path $scsiLun.CanonicalName -Vmfs -FileSystemVersion 3
# Copies the contents of a datastore folder in a local folder.
Copy-DatastoreItem vmstore:\Datacenter\Storage1\MyVM\* c:\VMFolder\MyVM\
# Removes the Datastore datastore from the host.
Remove-Datastore -Datastore Datastore -VMHost 10.23.112.234 -Confirm:$false
Step 3: Explore More Related Commands:
Get-DatastoreCluster | This cmdlet retrieves datastore clusters. |
Move-Datastore | This cmdlet moves datastores from one location to another. |
New-DatastoreCluster | This cmdlet creates a new datastore cluster. |
Remove-DatastoreCluster | This cmdlet deletes the specified datastore clusters. |
Set-Datastore | This cmdlet modifies the properties of the specified datastore. |
Set-DatastoreCluster | This cmdlet modifies the configuration of the specified datastore cluster. |