Skip to content

Instantly share code, notes, and snippets.

@lazywinadmin
Last active August 29, 2015 14:10
Show Gist options
  • Save lazywinadmin/e37531a484c3f213a59b to your computer and use it in GitHub Desktop.
Save lazywinadmin/e37531a484c3f213a59b to your computer and use it in GitHub Desktop.
Get the VIB information of VMware Hosts
Get-VMHost | Where-Object { $_.ConnectionState -eq “Connected” } | Foreach-Object {
$CurrentVMhost = $_
TRY
{
# Exposes the ESX CLI functionality of the current host
$ESXCLI = Get-EsxCli -VMHost $CurrentVMhost.name
# Retrieve Vib with name 'net-e1000e'
$ESXCLI.software.vib.list() | Where-object { $_.Name -eq "net-e1000e" } |
FOREACH
{
$VIB = $_
$Prop = [ordered]@{
'VMhost' = $CurrentVMhost.Name
'ID' = $VIB.ID
'Name' = $VIB.Name
'Vendor' = $VIB.Vendor
'Version' = $VIB.Version
'Status' = $VIB.Status
'ReleaseDate' = $VIB.ReleaseDate
'InstallDate' = $VIB.InstallDate
'AcceptanceLevel' = $VIB.AcceptanceLevel
}#$Prop
# Output Current Object
New-Object PSobject -Property $Prop
}#FOREACH
}#TRY
CATCH
{
Write-Warning -Message "Something wrong happened with $($CurrentVMhost.name)"
Write-Warning -Message $Error[0].Exception.Message
}
} | Out-GridView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment