PowerShell Genie

Get-ComputerInfo

Use Get-ComputerInfo to return a single object with over a hundred properties describing the operating system and hardware.

Command 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn — Get-ComputerInfo

Syntax

1PS> Get-ComputerInfo [[-Property] <string[]>] [<CommonParameters>]
See the command anatomy

Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.

Get-ComputerInfo [[-Property] <string[]>] [<CommonParameters>]
  1. Stage 1Get-ComputerInfo-Property

    Try it

    Windows PowerShell

    PowerShell example · browser support is limited.

    Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.

    Interactive simulation · fictional data

    Examples

    Get-ComputerInfo -Property OsName

    1PS> Get-ComputerInfo -Property OsName, OsVersion, CsTotalPhysicalMemory
    Show reference output

    Sample output · fictional data, shaped like the real thing

    OsName                         OsVersion  CsTotalPhysicalMemory
    ------                         ---------  ---------------------
    Microsoft Windows 11 Pro       10.0.26100  34319476736

    Get-ComputerInfo -Property Cs*

    1PS> Get-ComputerInfo -Property Cs* # every property in the computer-system group
    Show reference output

    Sample output · fictional data, shaped like the real thing

    OsName                         OsVersion  CsTotalPhysicalMemory
    ------                         ---------  ---------------------
    Microsoft Windows 11 Pro       10.0.26100  34319476736

    Select Caption, Version, LastBootUpTime

    1PS> Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, LastBootUpTime
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Caption  Version  LastBootUpTime
    -------  -------  --------------
    Microsoft Windows 11 Pro  10.0.26100  9/8/2026 6:15:04 AM

    Parameters

    Parameter definitions:

    • -Property

    Get-ComputerInfo on Microsoft Learn

    Practical use and troubleshooting

    Practical scenario: Use Get-ComputerInfo when you need to return a single object with over a hundred properties describing the operating system and hardware. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.

    Common error and fix: Blank properties can be unavailable on that OS or environment. Check one property and its provider separately rather than interpreting every missing value as collection failure. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.

    See also: Get-CimInstance. Get-ComputerInfo collects a broad computer summary; Get-CimInstance can query one specific class. Prefer a narrow query when a report needs only a small number of properties. Read the linked command before substituting it; similar names do not imply identical inputs or output.

    Get-ComputerInfo reference on Microsoft Learn

    Recap

    Get-ComputerInfo Use Get-ComputerInfo to return a single object with over a hundred properties describing the operating system and hardware.

    Next: Get-Item
    Genie guideGet-ComputerInfo

    Use Get-ComputerInfo to return a single object with over a hundred properties describing the operating system and hardware. The console below is pre-loaded — run it, then change a value and run it again.