⚡ PowerShell 5.1+
Get Computer System Product Info Report
Queries Win32_ComputerSystemProduct via WMI and reports Computer System Product Info in a formatted table, with an optional CSV export.
Get-ComputerSystemProductReport.ps1
<#
.SYNOPSIS
Reports Computer System Product Info on this computer via WMI (Win32_ComputerSystemProduct).
.DESCRIPTION
Queries Win32_ComputerSystemProduct and displays Name, Vendor, Version, IdentifyingNumber 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-ComputerSystemProductReport.ps1
.EXAMPLE
.\Get-ComputerSystemProductReport.ps1 -ExportPath C:\Reports\computersystemproduct.csv
#>
[CmdletBinding()]
param(
[string]$ExportPath
)
$items = Get-CimInstance -ClassName Win32_ComputerSystemProduct | Select-Object Name, Vendor, Version, IdentifyingNumber
if (-not $items) {
Write-Host "No Computer System Product 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
}