Last active
August 29, 2015 14:10
-
-
Save lazywinadmin/e37531a484c3f213a59b to your computer and use it in GitHub Desktop.
Get the VIB information of VMware Hosts
This file contains 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
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