Hi guys,
I am trying to access an embedded script resource in my management pack in a console task using its internal identifier of the form below. [I've used this syntax in a discovery script]
$fileresource[name="RunCustomApp.ps1"]/path$
Has anyone done this using VSAE 2012 against SCOM 2012 or know why mine throws the following error.
Here is the console task def.
<ConsoleTask ID="RunCustomApp" Accessibility="Public" Enabled="true" Target="Windows!Microsoft.Windows.Computer" RequireOutput="true" Comment="Test Console App. Task"> <assembly>res.custom.app</assembly> <handler>shellhandler</handler> <parameters> <argument name="workingdirectory" /> <argument name="application">%windir%\system32\windowspowershell\v1.0\powershell.exe</argument> <argument>$FileResource[name="RunCustomApp.ps1"]/path$</argument> </parameters> </consoletask>
The error is:
At line:1 char:15
+ $FileResource[Name=RunCustomApp.ps1]/Path$
+ ~
Array index expression is missing or not valid.
At line:1 char:15
+ $FileResource[Name=RunCustomApp.ps1]/Path$
Thanks,
Paul
- Edited by PaulJPower Tuesday, January 20, 2015 10:42 PM Improve code formatting