⚡ PowerShell 5.1+
Get Computer System Info Report
Queries Win32_ComputerSystem via WMI and reports Computer System Info in a formatted table, with an optional CSV export.
Get-ComputerSystemReport.ps1
<#
.SYNOPSIS
Reports Computer System Info on this computer via WMI (Win32_ComputerSystem).
.DESCRIPTION
Queries Win32_ComputerSystem and displays Name, Manufacturer, Model, TotalPhysicalMemory, NumberOfProcessors for each item found.
Use -ExportPath to also save the results to a CSV file.
.PARAMETER ExportPath
Optional path to a .csv file to write the results to.
.EXAMPLE
.\Get-ComputerSystemReport.ps1
.EXAMPLE
.\Get-ComputerSystemReport.ps1 -ExportPath C:\Reports\computersystem.csv
#>
[CmdletBinding()]
param(
[string]$ExportPath
)
$items = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object Name, Manufacturer, Model, TotalPhysicalMemory, NumberOfProcessors
if (-not $items) {
Write-Host "No Computer System Info found." -ForegroundColor Yellow
return
}
$items | Format-Table -AutoSize
if ($ExportPath) {
$items | Export-Csv -Path $ExportPath -NoTypeInformation -Encoding UTF8
Write-Host "`nExported to $ExportPath" -ForegroundColor Cyan
}