快速的一行,让你的你的主机硬件信息的概要:

Get-VMHost |SortName |Get- |

SelectName,
@{N=Type;E={
$_.Hardware.SystemInfo.Vendor++$_.Hardware.SystemInfo.Model}},
@{N
=CPU;E={
PROC:+$_.Hardware.CpuInfo.NumCpuPackages + CORES:+$_.Hardware.CpuInfo.NumCpuCores + MHZ: + [math]::round($_.Hardware.CpuInfo.Hz /1000000, 0)}},
@{N
=MEM;E={
“”+ [math]::round($_.Hardware.MemorySize / 1GB, 0) + GB}} | Export-Csvc:\hostinfo.csv

Output Example:

Name Type CPU MEM
prod01.domain.local Dell Inc. PowerEdge 2950 PROC: 2 CORES: 8 MHZ: 2993 32 GB
prod02.domain.local Dell Inc. PowerEdge 2950 PROC: 2 CORES: 8 MHZ: 2993 32 GB
prod03.domain.local Dell Inc. PowerEdge 2950 PROC: 2 CORES: 8 MHZ: 2993 32 GB
prod04.domain.local Dell Inc. PowerEdge 2950 PROC: 2 CORES: 4 MHZ: 2993 16 GB
tst10.domain.local Dell Inc. PowerEdge 2950 PROC: 2 CORES: 8 MHZ: 2660 16 GB
tst11.domain.local Dell Inc. PowerEdge 2950 PROC: 2 CORES: 8 MHZ: 2660 16 GB
tst12.domain.local Dell Inc. PowerEdge 2950 PROC: 2 CORES: 8 MHZ: 2660 16 GB
tst13.domain.local Dell Inc. PowerEdge 2950 PROC: 2 CORES: 8 MHZ: 2992 32 GB
tst14.domain.local Dell Inc. PowerEdge 2950 PROC: 2 CORES: 8 MHZ: 2992 32 GB
tst15.domain.local Dell Inc. PowerEdge 2950 PROC: 2 CORES: 8 MHZ: 2992 32 GB
tst16.domain.local Dell Inc. PowerEdge 2950 PROC: 2 CORES: 8 MHZ: 2992 32 GB