VSAE 2012 - Accessing an embedded powershell script resource in a SCOM MP Console Task

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
January 20th, 2015 6:07am

Hi,

If you are trying to run powershell script in management pack, please refer to the article below:

http://blogs.technet.com/b/brianwren/archive/2008/02/20/running-powershell-scripts-from-a-management-pack.aspx

In addition, here are two links regarding to VASE adding resource, hope them be helpful:

http://social.technet.microsoft.com/wiki/contents/articles/15693.operations-manager-management-pack-authoring-management-pack-formats.aspx

https://michelkamp.wordpress.com/2012/11/06/vsae-adding-binary-resource-features/

Regards,

Yan Li

Free Windows Admin Tool Kit Click here and download it now
January 21st, 2015 10:07am

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

Other recent topics Other recent topics