Advertisement
PureGremlin

ESX Embedded or installed

Dec 22nd, 2022 (edited)
826
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ########ESX Embedded or installed
  2.  
  3.  
  4. $array= @()
  5.  
  6. foreach($esx in Get-VMHost){
  7.  
  8.     $esxcli = Get-EsxCli -VMHost $esx
  9.  
  10.     $bootDev = $esxcli.system.boot.device.get()
  11.  
  12.     if($bootDev.BootFilesystemUUID){
  13.  
  14.         if($bootDev.BootFilesystemUUID[6] -eq 'e'){
  15.  
  16.             $obj = [pscustomobject]@{
  17.             Host = $esx.Name
  18.             Install = "Embedded"
  19.             }
  20.  
  21.         }
  22.  
  23.         else{
  24.  
  25.             $mountPoint = $esxcli.storage.filesystem.list() | where{$_.UUID -eq $bootDEV.BootFilesystemUUID} |
  26.  
  27.                 select -ExpandProperty MountPoint
  28.  
  29.             $obj = [pscustomobject]@{
  30.             Host = $esx.Name
  31.             Install = "Boot from device $($mountPoint)"
  32.             }
  33.  
  34.         }
  35.  
  36.     }
  37.  
  38.     else{
  39.  
  40.         if($bootDev.StatelessBootNIC){
  41.  
  42.    
  43.  
  44.             $obj = [pscustomobject]@{
  45.             Host = $esx.Name
  46.             Install = "Stateless, PXE boot from $(bootDev.StatelessBootNIC)"
  47.             }
  48.  
  49.         }
  50.  
  51.         else{
  52.  
  53.             $obj = [pscustomobject]@{
  54.             Host = $esx.Name
  55.             Install = "PXE Boot from $($bootDev.BootNIC)"
  56.             }
  57.  
  58.         }
  59.  
  60.     }
  61. $array+=$obj
  62. }
  63.  
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement