0

I have a script to power on HyperV cluster during maintenance activity.The cluster has 200+ VM's in it. When I execute this command it poweron all VM at time.

Get-Cluster -name <clustername> | Get-ClusterResource | where { $_.Name -and $_.state -eq "offline"} | Start-ClusterResource  

So is there anyway,so that we can create a condition here to start 20 VM's first then wait for 20 to 30 seconds the proceed with another 20. Again do the same procedure for all 200+ VM's in same manner ?

Can anyone help me here ?

Sandeep
  • 137
  • 11
  • 3
    https://stackoverflow.com/questions/20101579/can-powershell-loop-through-a-collection-n-objects-at-a-time – Matt Oct 12 '17 at 11:44
  • Possible duplicate of [I would like to start the cluster resources 5 at a time only](https://stackoverflow.com/q/46706244/1630171)? – Ansgar Wiechers Oct 12 '17 at 11:48
  • the command which I got from above link it poweron first 5 VMs and will it continue the poweron after sometime ? my requirement is it should start first 10 VMs first and then wait for 20 seconds then start next 20 again do the same procedure – Sandeep Oct 12 '17 at 12:14

0 Answers0