Automation

 View Only
  • 1.  how can I download this table in csv file

    Posted Jul 13, 2021 03:36 PM

    I am in need of getting a list of ESXi versions including Version Name, Build and Build Date. I have found the information on the VMware site at : https://kb.vmware.com/s/article/2143832

    Using PowerShell: $Response = Invoke-WebRequest -URI https://https://kb.vmware.com/s/article/2143832 returns an error "invoke-WebRequest unauthorized"

    I am trying to get a csv file of the version table on the page.

    Any suggestions?



  • 2.  RE: how can I download this table in csv file

    Posted Jul 13, 2021 03:57 PM

    did you try '-UseDefaultCredential' switch?

     

    $Response = Invoke-WebRequest -URI https://kb.vmware.com/s/article/2143832 -UseDefaultCredential



  • 3.  RE: how can I download this table in csv file

    Posted Jul 14, 2021 06:41 AM

    Why use that page and needing to extract the info from the HTML code?
    That info is available as a JSON file, see ESXi Version Information now available as JSON (incl. Script example)

    To get a CSV from that JSON file you can do

    Invoke-WebRequest -Uri http://www.virten.net/repo/esxiReleases.json | 
    ConvertFrom-Json |
    Select -ExpandProperty data | select -ExpandProperty esxiReleases |
    Export-Csv -Path .\esxiversions.csv -NoTypeInformation -UseCulture