In this article we look at retrieving operating system and system related information using Get-ComputerInfo command in powershell
With Get-ComputerInfo, an object is returned that contains system and operating system properties.
And like all objects in PowerShell, you can work with the data through the pipeline however you see fit.
Syntax
Get-Computer Info
[[-Property] <String[]>]
[<CommonParameters>]
Examples
Get all computer properties, this retrieves a huge list
PS C:> Get-ComputerInfo
On my PC I see this, this is a small list
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406 WindowsCurrentVersion : 6.3 WindowsEditionId : Professional WindowsInstallationType : Client WindowsInstallDateFromRegistry : 20/03/2021 05:42:01 WindowsProductId : 00330-80131-27477-AA204 WindowsProductName : Windows 10 Pro WindowsRegisteredOrganization : WindowsRegisteredOwner : user WindowsSystemRoot : C:\WINDOWS WindowsVersion : 2009 BiosCharacteristics : {7, 11, 12, 15...} BiosBIOSVersion : {ALASKA - 1072009} BiosBuildNumber : BiosCaption : Default System BIOS BiosCodeSet : BiosCurrentLanguage : BiosDescription : Default System BIOS BiosEmbeddedControllerMajorVersion : 255 BiosEmbeddedControllerMinorVersion : 255 BiosFirmwareType : Bios
You can filter out some of the properties by using -property with a word and a wildcard character * like this
PS C:> Get-ComputerInfo -Property “Windows*”
On my PC this displayed this
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406 WindowsCurrentVersion : 6.3 WindowsEditionId : Professional WindowsInstallationType : Client WindowsInstallDateFromRegistry : 20/03/2021 05:42:01 WindowsProductId : 00330-80131-27477-AA204 WindowsProductName : Windows 10 Pro WindowsRegisteredOrganization : WindowsRegisteredOwner : user WindowsSystemRoot : C:\WINDOWS WindowsVersion : 2009
You can also do something like this
PS C:> Get-ComputerInfo OsName,OsVersion,WindowsVersion
On my PC i saw something like this
OsName OsVersion WindowsVersion ------ --------- -------------- Microsoft Windows 10 Pro 10.0.19042 2009