Get-KFObject

Syntax

Get-KFObject
  -Name <string>
  [-ThrowErrors[:$true]]

Support

>= kenaflow 4.0.11

Return

Description

This cmdlet can be used to read data from the in-memory-cache previously written by Set-KFObject.

Parameters

[-Name] <string>

The key that is used to write data

[-ThrowErrors[:$true]]

This is a default parameter for all kenaflow cmdlets. If set to $true (default!) the engine will pass exception within the cmdlet to the script for further handling.

Example

The proProcessingScript specified in _wfconfig.ps1 could include the following line of Powershell script code:

Set-KFObject -Name "ListOfDataForExcelExport" -Object @()

The SharePoint workflow script could include this script code:

$d = Get-KFObject -Name "ListOfDataForExcelExport"
$d += @{Title = $item["Title"]; Id = $item.Id; Author = $item["Author"].LookupValue; Editor = $item["Editor"].LookupValue}
Set-KFObject -Name "ListOfDataForExcelExport" -Object $d

This creates an empty list in memory.

The postProcessingScript specified in _wfconfig.ps1 could include the following line of Powershell script code:

$data = Get-KFObject -Name "ListOfDataForExcelExport"
New-KFExcelFile -Input $data -SheetName "Output" -AsBase64 -Fields @("Id", "Title", "Author", "Editor")

Remove-KFObject -Name "ListOfDataForExcelExport" # This is not required because at the end of a workflow processing the in-memory-object is cleared!