Remove VIB using PowerCLI

I was trying to manually remove NSX VIBs using PowerCLI and found some of the examples and docs confusing, so here is a hopefully clearer example…

Connect-VIServer -Server vcenter.domain.com -User administrator@vsphere.local
@(
"esx01.domain.com",
"esx02.domain.com"
) | foreach {
$esxcli = get-esxcli -V2 -VMHost $_
$esxcli.software.vib.remove.Invoke(@{"vibname" = "esx-vxlan"})
$esxcli.software.vib.remove.Invoke(@{"vibname" = "esx-vsip"})
}

You can get more parameters with:

$esxcli.software.vib.remove.Help()

You can get a list of VIB modules with:

$esxcli.software.vib.list.Invoke() | select Name,ID,Version

Hope it helps someone!
Brian