PowerShell for Windows Admins:

PowerShell v2


June 16, 2011  1:26 PM

root\wmi – WmiMonitorColorCharacteristics



Posted by: Richard Siddaway
Hardware, PowerShell v2

The rather long winded name of this class might put you off but it does show something useful

Get-WmiObject -Namespace root\wmi -Class WmiMonitorColorCharacteristics

produces these results (dropping the system properties)

  Bookmark and Share     0 Comments     RSS Feed     Email a friend

June 16, 2011  11:03 AM

New MEAP release for PowerShell and WMI



Posted by: Richard Siddaway
Books, PowerShell v2, WMI

Chapters 10 and 11 have been added to the PowerShell and WMI early access release – www.manning.com/siddaway2

Chapter 10 is about printers and it covers:

  • discovering printer configurations;
  • testing printer...


June 14, 2011  11:12 AM

Scripting Guy Blog- PowerShell and WMI



Posted by: Richard Siddaway
Books, PowerShell v2, WMI

The Scripting Guy is running a series of posts this week featuring articles taken from PowerShell books published by Manning (www.manning.com). Yesterday was Don Jones’ PowerShell Lunches, today is my PowerShell and WMI

Read the articles and get the...


June 13, 2011  3:06 PM

Calculated Fields



Posted by: Richard Siddaway
PowerShell v2

You have probably seen something like this many times

Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=3" |
select @{Name="FreeSpace";Expression={$_.Freespace / 1GB}}

We take an object and perform a calculation to in effect make a new...


June 9, 2011  3:14 PM

Date Formats–custom formats



Posted by: Richard Siddaway
PowerShell v2

I’ve added examples of practically all of the custom elements that can be used in a date format

"d...


June 8, 2011  1:34 PM

PowerShell and WMI forum



Posted by: Richard Siddaway
PowerShell v2, WMI

I will be moderating a new forum for PowerShell on powershell.com  http://powershell.com/cs/forums/217.aspx

The forum is slanted towards PowerShell and WMI but happy to take...


June 6, 2011  1:57 PM

Get-WmiObject property parameter



Posted by: Richard Siddaway
PowerShell v2

This is a fairly obvious piece of PowerShell

Get-WmiObject Win32_Volume

We would probably restrict the properties we displayed like this

Get-WmiObject Win32_Volume | select DriveLetter, DriveType, Freespace

or possibly

Get-WmiObject Win32_Volume |


June 3, 2011  12:54 PM

Invoke-WmiMethod parameters



Posted by: Richard Siddaway
PowerShell v2, WMI

The Invoke-WmiMethod cmdlet was new with PowerShell 2. 

In PowerShell v1 we would do something like this

(gwmi win32_Process -Filter "Name='Notepad.exe'").Terminate()

With the cmdlet we can do this

gwmi win32_Process -Filter...


June 3, 2011  5:13 AM

Powers



Posted by: Richard Siddaway
PowerShell v2, PSAM

Many numbers in computing are based on powers of 2. I need to calculate some powers of 2 and realised that PowerShell doesn’t have  an operator for raising  a number  to a power.  In many languages ** or ^ supply this functionality.

In PowerShell we drop back to...


May 29, 2011  2:57 AM

Manning Deal of the Day–29 May



Posted by: Richard Siddaway
Books, PowerShell v2, WMI

Today, for one day only, get 50% off PowerShell and WMI MEAP or MEAP+ebook.

 

The code is dotd0529cc when you order from www.manning.com

 

The same code can be used for PowerShell in Action – second edition and...