Advertisement
PureGremlin

Remove-VIB

Sep 26th, 2023
1,346
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Remove-VIB($vmhost, $vib) {
  2.  
  3. if (!($vmhost) ) {$vmhost = read-host -Prompt "VMhost"}
  4. if (!($vib) ) {$vib = read-host -Prompt "VIB name"}
  5.  
  6. $esxcli = Get-VMHost $vmhost| Get-EsxCli -V2
  7.  
  8. if ($esxcli.software.vib.get.Invoke(@{'vibname'=$vib}) ) {
  9.     write-host "Found vib $VIB on $VMHost, deleting."
  10.     $ESXCLI.software.vib.remove.invoke(@{'vibname'=$vib})
  11.     }
  12.     else {
  13.         write-host "VIB $VIB not found on $VMHost, exiting."
  14.         }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement