Set-KFApproval

Syntax

Set-KFApproval
  [-ModerationState] <moderation-state> (Approved)
  [-Item <list-item>]
  [-Editor <sharepoint-user-object> ($null)]
  [-ThrowErrors[:$true]]

Support

>= kenaflow 1.0.0

Return

Nothing.

Description

This cmdlet is only available in SharePoint workflows!

It is used to immediately set the moderation state of the currently processed item or the item specified with -Item.

You need to known that this setting of the approval state will not last long because after further modifications of the item the moderation state is automatically reset by SharePoint.

To set the "final moderation state" at the end of the item processing please use cmdlet Set-KFFinalModerationState. This will be processed after kenaflow is (almost) finished with the current item.

When calling this cmdlet item modifications are send immediately to SharePoint.

Parameters

[-ModerationState] <moderation-state> (Approved)

The desired moderation state. Valid values are:

  • Approved
  • Rejected
  • Pending
  • Draft
  • Scheduled

[-Item <list-item>]

The list item to be used. If nothing is specified the currently processed list item is used.

[-Editor <sharepoint-user-object> ($null)]

The "editor" user to be set.

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

Discussion