Modules may contain PowerShell Script Library items and PowerShell Script items. The following section outlines some of the basic concepts you need to know for the following chapters.
PowerShell Script Library
The library items represent a collection of scripts, and may be structured with one or more levels of libraries.
You'll find that with the Integration Points some libraries should be created with specific names (i.e. Content Editor, Control Panel).
As a best practice we recommend that the Functions library consist of reusable scripts containing PowerShell functions (i.e. Do-Something) while other libraries contain the solution specific scripts (i.e. MakeScriptingGreatAgain).
Example: The following demonstrates the use of the Functions script library containing Get-DateMessage.
The script items represent the code that will be executed.
There are three conventions that we recommend you follow which are shown with an example below.
Title Casing - This should be used when the name will be exposed in places such as the Content Editor, script library names, and Reports root directory.
Sentence casing - This should be used when the name is long and will not be visible to the user or is a report with a very long name.
Noun-Verb - This should be used when the script is stored within the Functions script library and will be imported using the command Import-Function.
Interactive : Refer to the description shown for PowerShell Script Libraryfields.
Script (Script body) : This is a multi-line text than should be edited using the PowerShell ISE application.
PersistentSessionId (Persistent Session ID) : Context scripts using this ID will execute in a single session and be reused; leaving empty will cause the session to be discarded after execution. This value should be used for rules requesting the session ID.