Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save peterhynes/8198f714d3250bbff5c40c0aa53b0099 to your computer and use it in GitHub Desktop.

Select an option

Save peterhynes/8198f714d3250bbff5c40c0aa53b0099 to your computer and use it in GitHub Desktop.
Get hardware and esxi details for clusters
#Script to get bios version by Peter Hynes
#Version 1.0
#Created on the 11/04/2018
#Connect to the vCenter or vcenters and Run within PowerCLI
#You will need to create a txt file called clusters.txt and place it in the same folder as this script. Put the list of clusters you want to pull info from in to this txt file.
$clusters = get-content .\clusters.txt
try {
get-cluster $clusters |
Get-VMHost |
Select-Object -Property Name, @{N="Cluster";E={$cluster}},Manufacturer, Model, Version, Build,@{Name='BIOS Version';Expression={(($_|Select-Object -ExpandProperty ExtensionData).Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo | ?{$_.Name -like "*bios*"}).Name.Split(' ')[4]}} |
Export-Csv -Path .\ClusterHardwareAndEsxiVersion.csv -NoTypeInformation
Write-Host "Script Complete. Check folder where script is located for CSV" -ForegroundColor Green
}
catch {
Write-Host "$_.Exception.Message" -ForegroundColor Red
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment