This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is it possible to load Library Script in Scheduled Task using PowerShell ?

I have a large library of powershell functions that I would like to store in ARS as a library script and then call them from individual Scheduled Tasks, such as email, formatting, etc. I have attempted to add them Library Scripts but continually get an error such as "The term 'xfucntion' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."

I see posts in regards to this but they appear old, maybe I am missing something?

Here is an example:

https://www.quest.com/community/b/en/posts/using-library-scriptsa-inside-ars-powershell-scheduled-tasks-scripts#

 

Thank you for any responses....

Cheers!

-JN

Parents
  • I have used this in the past, built in solution would be preferrable as the SDK and KB Article indicate the only way to do it is VB Script

    $objScriptModule = [adsi]"EDMS://CN=Function Library,CN=Script Modules,CN=Configuration"

    $objScriptModule.RefreshCache("edsaScriptText")

    $libraryFunctionText = [string]($objScriptModule.edsaScriptText)

    Invoke-Expression $libraryFunctionText

Reply
  • I have used this in the past, built in solution would be preferrable as the SDK and KB Article indicate the only way to do it is VB Script

    $objScriptModule = [adsi]"EDMS://CN=Function Library,CN=Script Modules,CN=Configuration"

    $objScriptModule.RefreshCache("edsaScriptText")

    $libraryFunctionText = [string]($objScriptModule.edsaScriptText)

    Invoke-Expression $libraryFunctionText

Children
No Data