How do you run a Library Script using PowerShell?

How do you run a Library Script using PowerShell?

I can't find it in the docs or help file.  I did see mention of it on only one post.

I think what I saw was something like:

#--- include script library ---
$context.UseLibraryScript('Script Modules/Library/Workflow Functions')

 

If you do know where the docs that go over this I would appreciate it. 

Parents
  • That is the correct syntax.  It does not "run" the script - what it does is that it makes the functions contained in it available to the code that follows the above line.

    For example, I have function for creating log entries called "Logit".

    I can store this function in a library script, load the library script thus:

    $context.UseLibraryScript('Script Modules/Library/Johnny Logit')

    ...and then call the function:

    Set-QADUser JSmith -Description "Hello world"

    Logit "Just wrote Hello World to the JSmith's description"

Reply
  • That is the correct syntax.  It does not "run" the script - what it does is that it makes the functions contained in it available to the code that follows the above line.

    For example, I have function for creating log entries called "Logit".

    I can store this function in a library script, load the library script thus:

    $context.UseLibraryScript('Script Modules/Library/Johnny Logit')

    ...and then call the function:

    Set-QADUser JSmith -Description "Hello world"

    Logit "Just wrote Hello World to the JSmith's description"

Children