PowerCLI: Empty Resource Pool

Just a quick one today and I’m only putting it up here because it’s a one-liner and they always make me smile 🙂

Of the multiple clusters on one vCenter server that I’m working on, one of them has some resource pools that we don’t really need. Rather than dragging and dropping a few dozen VMs from one resource pool to the root resource pool of the cluster in the vSphere client I thought I’d use PowerCLI.

[ps]Get-ResourcePool -name "MyResourcePool" | Get-VM | Move-VM -Destination (Get-Cluster -name "MyCluster" | Get-ResourcePool -name "Resources")[/ps]

Job Done!