Legacy HDS Forums

Device Manager & Tuning Manager Custom Reporting using PowerShell 1.0

Discussion created by Legacy HDS Forums on Apr 17, 2009
Latest reply on Apr 18, 2009 by Legacy HDS Forums

Originally posted by: webfox



Custom Reporting with HDvM and HTnM is always very challenging.
For those of you who run them on Windows 2003 you can use Powershell to create reports.
Being a very loyal perl scripter I found PowerShell a pleasant surprise.

For e.g the simple code below :-

[font="Courier New"]C:\HiCommandCLI\Invoke-CmdScript.ps1 C:\HiCommandCLI\ArrayGroups.bat

$head = ''

$header = "

10057 Array Groups

"

$title = "Array Group Summary"

$xml = [xml] (get-content c:\HiCommandCLI\10057.PG.xml)

$query = "/DvMCLIResult/CommandResult/StorageArray/ArrayGroup[@allocatedCapacity>0]"

$xml.SelectNodes($query) | select displayName, diskType, diskSize, totalCapacity, allocatedCapacity | sort displayName | ConvertTo-HTML -head $head -body $header -title $title | Set-Content C:\ArrayGroup.html[/font]

Produces the report here :- [url="http://www.clearthoughtinc.us/kb/PSReports/ArrayGroup.html"]http://www.clearthoughtinc.us/kb/PSReports/ArrayGroup.html[/url]


Read more at [url="http://www.clearthoughtinc.us/kb/"]http://www.clearthoughtinc.us/kb/[/url]

Outcomes