< Kapil Mathur is in the process of learning PowerShell to work with WMI and wrote up his findings to date – jps>
Automating admin scenarios using PowerShell
The preferred scripting language for the WMI world has been vbscript. But if you are a windows administrator writing WMI scripts, chances are that you have been hearing another name lately- PowerShell.
To compare the scripting experience in between the two, I tried out my hand at automating some admin scenarios by converting "vbscript" scripts into "PowerShell" scripts.
I took two scripts from Alain Lissoir's book "Leveraging Windows Management Instrumentation (WMI) Scripting" (http://www.lissware.net ) and rewrote them into PowerShell. The scripts covered the following areas -
So here's my experience with PowerShell vis-à-vis vbscript so far –
$IPAddresses = "125.125.125.125","200.200.200.200"
$IPAddresses = $ IPAddresses + "250.250.250.250"
Or if you want to create a string array of some size and initialize it, you write - [string[]]$IPAddresses = @("cool")*$ParsedValue.length
In another post, I'll cover the wmi based monitoring story with PowerShell.
Kapil Mathur