One of the things I noticed in the recent Scripting Games was that a lot of the scripts would do things like this
$query = "Select MaxClockSpeed from Win32_Processor"
$proc = Get-WmiObject -Query $query
Write-Host "Speed: " $proc.MaxClockSpeed
If you’ve used ping before you’ll know that it normally returns four replies from the target. In PowerShell we have Test-Connection which does the same job. It also normally returns four replies.
When I’m working with remote machines I often want to check they are available...
Thank you to everyone who joined the Live Meeting this evening. Hope you enjoyed the session on PowerShell events.
The slides and demo files are available from
PowerShell in Practice will be going to the printers next week.
Between now and 21 May 2010 you can get 40% off of PowerShell in Practice (and other Manning books that are in the final stages of production)
Use promotional code m1440 at checkout from
We can use WMI to access the registry on local and remote machines – if you remember back to VBScript it was the way to access the registry. In PowerShell we have a couple of PowerShell drives available through the provider Name ...
String substitution is one of my favourite bits of PowerShell. If you’ve not seen it before the idea is that you can substitute a variable into a double quoted string. Note that single quote strings won’t work. As an example PS> $colour = "red" PS> "The balloon is $colour" The...
When: Tuesday, May 18, 2010 7:30 PM (BST) Where: Live Meeting *~*~*~*~*~*~*~*~*~*PowerShell eventing using WMI, .NET and the PowerShell engine Notes Richard Siddaway has invited you to attend an online meeting using Live Meeting.
If you’ve used VBScript in the past you will remember using Win32_PingStatus to test the connectivity to a remote machine. In the 2010 Scripting Games we’ve seen a lot of scripts testing if a remote machine can be contacted.
Many of the scripts contain code of the form