Getting good hardware information is very useful on a Windows system, I will show some very useful one-liners for getting hardware information on Windows.
This example gives information about the CPU cores and the other pertinent CPU information.
PS C:\Users\Intel i5> Get-WmiObject –class Win32_processor | ft systemname,Name,DeviceID,NumberOfCores,NumberOfLogicalProcessors systemname Name DeviceID NumberOfCores NumberOfLogicalProcessors ---------- ---- -------- ------------- ------------------------- DESKTOP-PF01IEE Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz CPU0 6 12 |
This example prints all IP addresses in a table.
PS C:\Users\Intel i5> Get-NetIPAddress | Format-Table ifIndex IPAddress PrefixLength PrefixOrigin SuffixOrigin AddressState PolicyStore ------- --------- ------------ ------------ ------------ ------------ ----------- 10 fe80::948f:319f:ac29:d5f6%10 64 WellKnown Link Preferred ActiveStore 10 fdc8:1451:5fa9:4700:c87c:a3c0:9662:6ed7 128 RouterAdv... Random Preferred ActiveStore 10 fdc8:1451:5fa9:4700:948f:319f:ac29:d5f6 64 RouterAdv... Link Preferred ActiveStore 1 ::1 128 WellKnown WellKnown Preferred ActiveStore 10 192.168.1.114 24 Dhcp Dhcp Preferred ActiveStore 1 127.0.0.1 8 WellKnown WellKnown Preferred ActiveStore |
Use this one-liner in Powershell to print various information about your Windows installation and hardware.
PS C:\Users\Intel i5> Get-ComputerInfo -Property CsProcessors,CsTotalPhysicalMemory,TimeZone,OsName,WindowsInstallDateFromRegistry CsProcessors : {Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz} CsTotalPhysicalMemory : 17026232320 TimeZone : (UTC+10:00) Canberra, Melbourne, Sydney OsName : Microsoft Windows 11 Home WindowsInstallDateFromRegistry : 17/12/2021 7:15:05 PM |
And this is how to print out information about the installed computer graphics card. This is easy with Powershell.
PS C:\Users\Intel i5> Get-WmiObject Win32_VideoController -ComputerName . -Property VideoProcessor,VideoModeDescription,DriverVersion __GENUS : 2 __CLASS : Win32_VideoController __SUPERCLASS : __DYNASTY : __RELPATH : __PROPERTY_COUNT : 3 __DERIVATION : {} __SERVER : __NAMESPACE : __PATH : DriverVersion : 30.0.14.9709 VideoModeDescription : 3440 x 1440 x 4294967296 colors VideoProcessor : NVIDIA GeForce RTX 2060 PSComputerName : |
And finally, to get the computer name, use this command.
PS C:\Users\Intel i5> [Environment]::MachineName DESKTOP-PF01IEE |
As well as the number of logical CPU cores.
PS C:\Users\Intel i5> [Environment]::ProcessorCount 12 |