This commit is contained in:
Zack Meier
2026-04-15 15:42:41 -05:00
parent 74edcc4d9a
commit 03dba08135
146 changed files with 9119 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
$AllVMHosts = Get-VMHost
$Result = [System.Collections.ArrayList]@()
ForEach($VMHost in $AllVMHosts){
$EsxCli = $VMHost | Get-EsxCli -V2
$obj = [PSCustomObject]@{
Name = $VMHost.Name;
SerialNumber = $EsxCli.hardware.platform.get.Invoke().SerialNumber;
AssetNumber = ($VMhost.ExtensionData.Summary.Hardware.OtherIdentifyingInfo | select IdentifierValue,@{n='Label';e={$_.IdentifierType.Label}} | where-object Label -eq "Asset Tag")."Asset Tag";
Model = $VMHost.Model;
CPU = $VMHost.ProcessorType;
CPU_ClockGHz = $VMHost.ProcessorType.split('@ ')[1] -replace 'GHz';
CPU_Sockets = $VMHost.Extensiondata.Summary.Hardware.NumCpuPkgs;
CPU_TotalCores = $VMHost.Extensiondata.Summary.Hardware.NumCpuCores;
MemoryTotalGB = $VMHost.MemoryTotalGB
Location = '';
Enclosure = '';
}
$null = $Result.Add($obj)
}
$Result | Export-Csv "C:\users\zmeier\desktop\hostinventory.csv"