The PowerShell console can also allow us to check the version of the Windows operating system. The PowerShell cmdlet "Get-ComputerInfo" can retrieve several dozens of information about the local machine, including its name, processor type, Windows version, and build number. It relies on reading different WMI classes to function.
Open a PowerShell console and enter the following command:
Get-ComputerInfo | Format-Table OsName, OSDisplayVersion, OsBuildNumber
Here is the result obtained:
This command returns the name of the system, the edition, the name of the major version, and the version number, but it lacks precision on the revision number (the famous "3447"). The property "OsHardwareAbstractionLayer" returns a more precise version number, but it does not correspond to what we are looking for.
Finally, to obtain a result as precise as with the graphical interface, we must read the information present in the Windows Registry:
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName, CurrentBuild, UBR | Select-Object -Property ProductName, CurrentBuild, UBR
Here is the result obtained: