Hello,
I'm trying to create a Diagnostic which leverages a PowerShell script (I've been working solely with VBScript thus far), hosted by the probe action module Microsoft.Windows.PowerShellProbe, and am having problems passing a boolean parameter to the script. I have built the following Parameters section, build according to http://www.code4ward.net/main/Blog/tabid/70/EntryId/50/How-to-create-a-PowerShell-task-for-OpsMgr-using-the-Authoring-Console.aspx:
<Parameters>
<Parameter>
<Name>TopN</Name>
<Value>$Config/TopN$</Value>
</Parameter>
<Parameter>
<Name>Debug</Name>
<Value>$Config/Debug$</Value>
</Parameter>
</Parameters>
I'm having troubles forcing the Debug paramter to a boolean type in my PoSH script. Here is my ProbeActionmodule's Configuration section:
<Configuration>
<xsd:element minOccurs="1" name="TopN" type="xsd:integer" />
<xsd:element minOccurs="1" name="TimeoutSeconds" type="xsd:integer" />
<xsd:element minOccurs="1" name="Debug" type="xsd:boolean" />
</Configuration>
When I force the Debug parameter from within the PoSH script as follows, the task consistently returns No output available (despite the fact that the script runs as expected on its own):
Param(
[int]$TopN,
[bool]$Debug
)
The task only works when I define the parameter as a string, as follows:
Param(
[int]$TopN,
$Debug
)
Updating the Debug parameter by adding a '$' in front of the $Config/Debug$ variable (in order to accomodate PoSH's boolean value requirement (i.e. $true | $false)), as shown here, does not resolve the problem:
<Parameter>
<Name>Debug</Name>
<Value>$$Config/Debug$</Value>
</Parameter>
Does anyone have any suggestions?
T