June 16, 2011 11:03 AM
Posted by: Richard Siddaway
Books,
PowerShell v2,
WMIChapters 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
Posted by: Richard Siddaway
Books,
PowerShell v2,
WMIThe 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
Posted by: Richard Siddaway
PowerShell v2You 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
Posted by: Richard Siddaway
PowerShell v2I’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
Posted by: Richard Siddaway
PowerShell v2,
WMII 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
Posted by: Richard Siddaway
PowerShell v2This 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
Posted by: Richard Siddaway
PowerShell v2,
WMIThe 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
Posted by: Richard Siddaway
PowerShell v2,
PSAMMany 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
Posted by: Richard Siddaway
Books,
PowerShell v2,
WMIToday, 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...