Exploring Get-ComputerInfo: A PowerShell Cmdlet for System Insight
Welcome back to Wahmans PowerShell blog! Today we are diving into a powerful and often underrated cmdlet in PowerShell — Get-ComputerInfo. This cmdlet is your gateway to quickly retrieving an extensive list of system and operating system properties from your local machine. Whether you’re an IT administrator, a developer, or just a PowerShell enthusiast, Get-ComputerInfo has something valuable to offer.
What is Get-ComputerInfo?
According to Microsoft, “Get-ComputerInfo gets a consolidated object of system and operating system properties.” That means it rapidly compiles system specs such as OS version, BIOS information, network configuration, hardware details, and much more — all at your fingertips through a single cmdlet.
Let’s look at how we can put this to practical use by exploring four examples, starting with beginner-level tasks and gradually moving into more advanced scenarios.
🧪 Example 1: Get Basic System Info (Beginner)
If you simply want to explore what Get-ComputerInfo provides, just run it without any parameters:
Get-ComputerInfo
This outputs a huge object with lots of system details. To narrow it down, a great trick is to filter by property names using Select-Object:
Get-ComputerInfo | Select-Object CsName, OsName, WindowsVersion, OsArchitecture
This gives you the basic system name, OS name, version, and architecture.
⚙️ Example 2: Check Windows Activation Status (Intermediate)
You can pull the Windows activation status like this:
Get-ComputerInfo | Select-Object WindowsProductName, WindowsEditionId, OsRegisteredUser, OsActivationStatus
This is useful for IT admins trying to audit machines for license compliance.
📋 Example 3: Export System Info to a CSV File (Intermediate)
Let’s say you’re doing an audit and want to collect system data into a CSV:
$computerInfo = Get-ComputerInfo |
Select-Object CsName, OsName, WindowsVersion, BiosManufacturer, BiosVersion, CsSystemFamily
$computerInfo | Export-Csv -Path "C:\Temp\SystemInfo.csv" -NoTypeInformation
This snippet will export the info to a CSV file ready for analysis or reporting.
🕵️♂️ Example 4: Compare BIOS Version Across Multiple Machines (Advanced)
In a domain environment, you might want to check that BIOS versions are up-to-date. Assuming you have a list of computer names in a text file:
$computers = Get-Content -Path "C:\Temp\ComputerList.txt"
foreach ($computer in $computers) {
try {
$info = Invoke-Command -ComputerName $computer -ScriptBlock {
Get-ComputerInfo | Select-Object CsName, BiosVersion, BiosReleaseDate
}
$info
}
catch {
Write-Warning "Could not retrieve info from $computer"
}
}
This sample queries each machine remotely and pulls BIOS version and release date. Very handy for hardware audits or compliance checks.
Wrapping Up
Get-ComputerInfo is a robust command for gathering local machine data in PowerShell. It’s fast, convenient, and incredibly informative. Whether you’re doing diagnostics, generating reports, or simply learning PowerShell, this cmdlet is a must-have in your toolbox.
Happy scripting, and I will see you in the next post!
Leave a Reply