Windows PowerShell


PowerShell - Memory

PowerShell - Disk Check with CIM_PhysicalMemory

Our mission to investigate and interrogate a computer's disk.  Goals include discovering the size of each volume and how much free space is available on each of those volumes.  We also have pure PowerShell goals, to examine the 'Select' statement, and to control the display with -groupby |sort and -auto.

Topics for PowerShell Disk Check

Trusty Twosome (Get-Help and Get-Member)

When you discover a new PowerShell command, it benefits from being surveyed with what I call the 'Trusty Twosome'.  Research with Get-Help and Get-Member and reveal new scripting possibilities for Get-WmiObject CIM_PhysicalMemory. To see what I mean try these two commands:

1) get-help Get-WmiObject CIM_PhysicalMemory
    (help gwmi CIM_PhysicalMemory) If you like abbreviations.
    (help gci -full) If you prefer examples.

Get-help unearths useful parameters such as -class and -computerName (-computer also works).

2) get-WmiObject CIM_PhysicalMemory |get-Member
    (gwmi CIM_PhysicalMemory | gm) If you enjoy aliases.
    (gwmi CIM_PhysicalMemory| gm -Membertype property) If you are fond of filters.

Get-Member (gm) reveals a whole host of properties that you don't normally see in the Control Panel.

Example 1a - Display CIM_PhysicalMemory

The simplest possible script to display memory

# Display CIM_PhysicalMemory
get-wmiobject -query "Select * from CIM_PhysicalMemory" |Ft

  ˚

See more Microsoft PowerShell tutorials:

PowerShell Home  • Com  • Shell Application  • Active Directory  • QAD Snap-in  • Get-Member

Please write in if you see errors of any kind.  Please report any factual mistakes, grammatical errors or broken links, I will be happy to not only to correct the fault, but also to give you credit.

Download my ebook:Getting Started with PowerShell
Getting Started with PowerShell - only $9.25

You get 36 topics organized into these 3 sections:
   1) Getting Started
   2) Real-life tasks
   3) Examples of Syntax.

In addition to the ebook, you get a PDF version of this  Introduction to PowerShell ebook  It runs to 120 pages of A4.

 *


Google

WebThis Site

Guy Recommends: SolarWinds Exchange Monitor

Exchange Monitor from SolarWindsHere is a free tool to monitor your Exchange Server

 

Home Copyright © 1999-2008 Computer Performance LTD All rights reserved

Please report a broken link, or an error.