Connect to many ESX hosts


/ Published in: Windows PowerShell
Save to your folder(s)



Copy this code and paste it in your HTML
  1. @(1..25) + @(99..100) | ForEach-Object {
  2. Write-Host $hostname
  3. $hostname = "w1-vdi" + $_.ToString().PadLeft(3, "0") + ".eng.blah.com"
  4. Connect-VIServer -Server $hostname -User root -Password blah
  5. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.