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.

Get-ResourcePool -name "MyResourcePool" | Get-VM | Move-VM -Destination (Get-Cluster -name "MyCluster" | Get-ResourcePool -name "Resources")

Job Done!

Michael is a Senior Consultant for Xtravirt. If it's got buttons or flashy lights on it then it'll probably be on his radar. When not "mending computers" (it's sometimes easier than explaining "cloud" to relatives), Michael provides essential education, entertainment and trampoline services to his two children.

Leave a Reply

Your email address will not be published. Required fields are marked *

Powered by sweet Captcha