Get-KFNormalizedCAML

Syntax

Get-KFNormalizedCaml
  [-Query] <string>
  [-ThrowErrors[:$true]]

Support

>= kenaflow 1.0.0

Return

String.

Description

If you want to work directly with CAML - the SharePoint query language - then you need to keep in mind that the And and Or tags must each have exactly two suitable sub-objects.

Not valid would be:

<Where><And><Eq>...</Eq></And></Where>

...because here is just one Eq under ´And´.

Also not valid is:

<Where><Or><Eq>...</Eq><Gt>...</Gt><Lt>...</Lt></Or></Where>

...because here the Or-Tag has three subnodes (Eq, Gt, Lt).

This kind of problems occur, if CAML is built dynamically.

Parameters

[-Query] <string>

This is the CAML string to be corrected.

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

Cls; Import-Module "C:\Program Files\kenaflow.runtime.dll"

Start-KFSharePointModule -SharePointVersion sp2013

Get-KFNormalizedCaml -Query "<Where><And><Eq>…</Eq></And></Where>"

Get-KFNormalizedCaml "<Where><Or><Eq>..</Eq><Gt>..</Gt><Lt>..</Lt></Or></Where>"

Discussion