PowerCLI: Migrate all vm's on a datastore

PowerCLI is just awsome 🙂 This simple one-liner migrates all vm’s off one datastore to a new one: Get-VM -Datastore <datastore1> | Move-VM -Datastore <datastore2> You can also move vm’s off one datastore and place them in any datastore within a specified datastore cluster: $DatastoreCluster1 = Get-DatastoreCluster -Name 'DatastoreCluster1' Get-VM -Datastore <datastore1> | Move-VM -Datastore $DatastoreCluster1

October 8, 2013 Â· nerenther