showui 1.1 and visifire

Aug 6, 2011 at 8:01 PM

with powerboots I was able to create simple charts as dempstrated here I have been trying to do this with showui but can not get it to work.  THis is what I have been doing

in the console I am getting things setup

 import-module showui
 add-UIModule -path .\Visifire\wpftoolkit.dll -Name WPFToolkit -AsCmdlet
 import-module WPFToolkit
 add-UIModule -path .\Visifire\wpfVisifire.charts.dll -Name Visifire -AsCmdlet
 import-module VisiFire
 Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 

this is my simple script

$chart = Chart -MinWidth 400 -MinHeight 200 -Theme Theme2 -View3D `
  -AnimationEnabled:$false (
  DataSeries $( $MDBs = Get-MailboxDatabase | Select-Object Name
  foreach ($MDB in $MDBs) {
  $count = (Get-Mailbox -Database $MDB.Name | Measure-Object).Count
      DataPoint -YValue ($count) -AxisXLabel $MDB.Name
  )  -RenderAs bar

THis is the error I am getting

New-Chart : Cannot convert 'Visifire.Charts.DataSeries' to the type 'System.Management.Automation.SwitchParameter' required by parameter '
At line:1 char:15
+ $chart = Chart <<<<  -MinWidth 400 -MinHeight 200 -Theme Theme2 -View3D `
    + CategoryInfo          : InvalidArgument: (:) [New-Chart], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,AutoGenerateCmdlets37345264.NewChartCommand


I have tried setting ThemeEnabled to false but run into a different error and most likely would not like the results

New-Chart : Cannot bind parameter 'SamplingThreshold'. Cannot convert the "Visifire.Charts.DataSeries" value of type "Visifire.Charts.Data
Series" to type "System.Int32".
At line:1 char:19
+ $chart = new-Chart <<<<  -ThemeEnabled:$false -MinWidth 400 -MinHeight 200 -Theme Theme2 -View3D `
    + CategoryInfo          : InvalidArgument: (:) [New-Chart], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,AutoGenerateCmdlets37345264.NewChartCommand


Are there any samples out there usingshowui pulling data form Exchange or AD that I can study. I am trying to figure out how to use -series and dataseries, I am pretty new to .net scripting.


Aug 7, 2011 at 3:52 AM

Try specifying the parameter name.  In ShowUI 1.1 the "Series" and "DataPoints" aren't known as content parameters, because they aren't.  It's possible to create rules to generate those better using our rules engine, but it'll be fixed in ShowUI 1.2 anyway.

$chart = Chart -MinWidth 400 -MinHeight 200 -Theme Theme2 -View3D `
  -AnimationEnabled:$false -Series {
   DataSeries -DataPoints { 
      foreach ($MDB in Get-MailboxDatabase | Select-Object Name) {
         $count = (Get-Mailbox -Database $MDB.Name | Measure-Object).Count
         DataPoint -YValue ($count) -AxisXLabel $MDB.Name
   }  -RenderAs bar

Aug 7, 2011 at 9:39 PM

Thanks, So where do I go to read up more on what is a content parameter and what is not ? Also more about the available parameters such as series, DataSeries and datapoints ?