Collect hardware summary
Documentation: Microsoft Learn
Collect CPU model, RAM in GiB, and BIOS version with Get-CimInstance, then combine the results into one PowerShell object.
The script
Script reader
Inspect before you run
Inspect the script below. It does not run in this browser.
Inspection only — no command has run.
Show reference output
Inspect this example’s structure
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
[pscustomobject]@{Computer= $env:COMPUTERNAME;CPU=(Get-CimInstance Win32_Processor | Select-Object -Expand Name -First 1);RAMGB= [math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory/1GB, 1);BIOS=(Get-CimInstance Win32_BIOS).SMBIOSBIOSVersion}- Stage 1[pscustomobject]@{Computer=
Positional values or no named parameters
How it works
A [pscustomobject] literal assembles the row in one shot. The CPU field pulls the first Name off Win32_Processor using -Expand so it lands as a string rather than a wrapper object, RAMGB reads TotalPhysicalMemory from Win32_ComputerSystem and converts with a 1GB divisor, and BIOS takes SMBIOSBIOSVersion from Win32_BIOS.
Adapting it
Wrap the literal in a function that accepts a computer name and pass it through to each Get-CimInstance call, which converts a single-host snapshot into something you can run down an inventory list.
If the result is unexpected
The hardware row is missing CPU or BIOS details, or RAM differs from the installed capacity.
CPU, memory and BIOS values come from separate CIM classes; firmware reservations and multiple processors affect the summary.
- Query each CIM class separately and inspect its returned properties before assembling the row.
Validate the result
The row identifies the intended computer and matches the individual CIM results.
Keep the check reliable
Record the queried computer and distinguish OS-visible memory from purchased capacity.