Set-KFDBData

Syntax

Set-KFDBData
  [-Key] <key>
  [-Data] <data>
  [-RelatedToWorkflow[:$true]] 
  [-RelatedToItem[:$true]]
  [-ThrowErrors[:$true]]

Support

>= kenaflow 1.0.0

Return

Deserialized object or $null.

Description

This cmdlet serialize and persist data to the kenaflow SQLite database.

If the requested object exist, it will be overwritten. An exception is not thrown.

We have described this in article Persisting Data, section "kenaflow SQLite Persistence".

By default -RelatedToWorkflow[:$true] and -RelatedToItem[:$true] are used - alone or in combination - to automatically add prefix(es) to your key.

Parameters

[-Key] <string>

The key that is used to read the serialized data.

[-Data] <data>

This is the data to be serialized and persisted.

[-RelatedToWorkflow[:$true]]

If you do not specify -RelatedToWorkflow:$false the workflow id will be used as prefix for your -Key. This is the default behaviour.

[-RelatedToItem[:$true]]

If you do not specify -RelatedToItem:$false the current item id will be used as prefix for your -Key. This is the default behaviour. The parameter is only available for SharePoint workflows! In SharePoint site workflows there is no item context.

[-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

Set-KFDBData -Key "kenaflow" -Data @{"is" = "a workflow engine for SharePoint, Email and PowerShell"} -RelatedToItem:$false -RelatedToWorkflow:$false
Write-KFLog (Get-KFDBData -Key "kenaflow" -RelatedToItem:$false -RelatedToWorkflow:$false)
Remove-KFDBData -Key "kenaflow" -RelatedToItem:$false -RelatedToWorkflow:$false

Discussion