Skip to content

Instantly share code, notes, and snippets.

@HostileCoding
Created May 29, 2014 08:45
Show Gist options
  • Select an option

  • Save HostileCoding/3685408cb910b1b70774 to your computer and use it in GitHub Desktop.

Select an option

Save HostileCoding/3685408cb910b1b70774 to your computer and use it in GitHub Desktop.
#Variable declaration
$hosts=@("192.168.243.144","10.0.1.62") #ESXi hosts to download support bundles from
$username="root" #ESXi host username
$password="vmware" #ESXi host password
$destination = "C:\Users\Paolo\Desktop" #Location where to download support bundles
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} #Ignore SSL certificate validation
foreach ($element in $hosts){
$wc = New-Object System.Net.WebClient
$wc.Credentials = new-object System.Net.NetworkCredential($username, $password) #This assumes all hosts having same username and password
$wc.DownloadFile("https://"+$element+"/cgi-bin/vm-support.cgi", $destination + "\" + $element + ".tgz") #Download support bundle
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment