PowerShell for Windows Admins

Jul 1 2010   12:54PM GMT

Computer System Information

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

The basic information on your system – name, model, CPUs and RAM can be easily obtained

Get-WmiObject -Class Win32_ComputerSystem | 
Format-List Name, Manufacturer, Model, 
SystemType, Description,
NumberOfProcessors, NumberOfLogicalProcessors,
@{Name="RAM"; Expression={[math]::round($($_.TotalPhysicalMemory/1GB), 2)}}

use the Win32_Computersystem class and select the relevant properties.  Only new bit is using the round method of System.Math to round the result of converting the memory from bytes to GB. The 2 represents the number of decimal digits I want

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: