Created
May 29, 2014 08:45
-
-
Save HostileCoding/3685408cb910b1b70774 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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