Libraries

You can specifiy PowerShell files as libraries at the global configuration level and in each workflow configuration file.

These libraries are executed immediately BEFORE each workflow script or pre-query script.

If specified first the global library is executed and than second the local library.

Global library configuration (kenaflow.conf):

The path is relative to the program directory (e.g. C:\Program Files\kenaflow).

Local library in workflow configuration file _wfconfig.ps1:

The path is relative to the workflow folder.

The use of global variables is possible:

$global:value = 1
function HelloKenaflow() {
	Write-KFLog "Hello kenaflow: $global:value"
	$global:value++
}

For each list element that in the context of a workflow execution of is processed in a workflow script, you can use this function Hellokenaflow, whereby the contents of the global variable $$global:value is increased by 1.

When processing of this workflow is complete, the PowerShell session and the global variables are discarded.

Both library files do not operate within an SharePoint or email context. Parameters are not provided in this script.

Discussion