Get-ItemField

Retrieves item fields as either names or fields or template fields.

Syntax

Get-ItemField [-Item] <Item> [-IncludeStandardFields] [-ReturnType <Name | Field | TemplateField>] [-Name <String[]>] [-Language <String[]>]

Get-ItemField [-Path] <String> [-IncludeStandardFields] [-ReturnType <Name | Field | TemplateField>] [-Name <String[]>] [-Language <String[]>]

Get-ItemField -Id <String> [-Database <String>] [-IncludeStandardFields] [-ReturnType <Name | Field | TemplateField>] [-Name <String[]>] [-Language <String[]>]

Detailed Description

Retrieves item fields as either names or fields or template fields.

© 2010-2019 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions

Parameters

-IncludeStandardFields <SwitchParameter>

Includes fields that are defined on "Standard template"

-ReturnType <ReturnValue>

Determines type returned. The possible values include:

  • Name - strings with field names.

  • Field - fields on the item

  • TemplateField - template fields.

-Name <String[]>

Array of names to include - supports wildcards.

-Language <String[]>

Language that will be analysed. If not specified the current user language will be used. Globbing/wildcard supported.

-Item <Item>

The item to be analysed.

-Path <String>

Path to the item to be analysed.

-Id <String>

Id of the item to be analysed.

-Database <String>

Database containing the item to be analysed - can work with Language parameter to narrow the publication scope.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • Sitecore.Data.Items.Item

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Sitecore.Data.Items.Item

    Sitecore.Data.Templates.TemplateField

    Sitecore.Data.Fields.Field

Notes

Help Author: Adam Najmanowicz, Michael West

Examples

EXAMPLE 1

Get list of names of non standard fields from /sitecore/content/home item

PS master:\> Get-ItemField -Path master:\content\home

Text
Title
Image

EXAMPLE 2

Get list of fields including standard fields from /sitecore/content/home item and list their Name, DisplayName, SectionDisplayName and Description in a table.

PS master:\> Get-Item master:\content\home | Get-ItemField -IncludeStandardFields -ReturnType Field -Name "*" | ft Name, DisplayName, SectionDisplayName, Description -auto

Name                                DisplayName                        SectionDisplayName Description
----                                -----------                        ------------------ -----------
__Revision                          Revision                           Statistics
__Standard values                   __Standard values                  Advanced
__Updated by                        Updated by                         Statistics
__Validate Button Validation Rules  Validation Button Validation Rules Validation Rules
__Created                           Created                            Statistics
__Thumbnail                         Thumbnail                          Appearance
__Insert Rules                      Insert Rules                       Insert Options
__Short description                 Short description                  Help
__Created by                        Created by                         Statistics
__Presets                           Presets                            Layout
Text                                Text                               Data               The text is the main content of the document.

Last updated