Powershell Widget Header

Is there a way to put header info on a powershell widget

e.g. Description is Gateways with (<count>) added by code

you set up the Grid Widget to return a set of rows with desired info

it would be nice to add count beside description on the

February 18th, 2015 11:40am

Hi!

Header = Title? No.

Header = Column name? Yes:

$OUT = "<catalog><book id='1'><Status>Active</Status><Count>20</Count><Instance>ORA81</Instance></book><book id='2'><Status>Active</Status><Count>25</Count><Instance>ORA82</Instance></book></catalog>"
 $xmlObject = [XML]$OUT
  $Result = $xmlObject.SelectNodes("//book")

  foreach($object in $Result) {
  $dataObject = $ScriptContext.CreateInstance("xsd://foo!bar/baz")
  $dataObject["Id"] = [String]($object.Id)
# here is the column with the variable:
  $dataObject["Count (Sum: $Result.count)"] = [String]($object.Count)
  $dataObject["Status"] = [String]($object.Status)
  $dataObject["Instance"] = [String]($object.Instance)
  $ScriptContext.ReturnCollection.Add($dataObject)
}
 

See the  "Count (Sum: $Result.count)" after the comment line. This is untested (got no lab connectivity) but should work as long as the variable stays same for each object.

Cheers,
Patrick

Free Windows Admin Tool Kit Click here and download it now
February 18th, 2015 3:01pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics