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"
Aliases
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-ReturnType <ReturnValue>

Determines type returned. The possible values include:
    Name - strings with field names.
    Field - fields on the item
    TemplateField - template fields.
Aliases
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Name <String[]>

Array of names to include - supports wildcards.
Aliases
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Language <String[]>

Language that will be analysed. If not specified the current user language will be used. Globbing/wildcard supported.
Aliases
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Item <Item>

The item to be analysed.
Aliases
Required?
true
Position?
1
Default Value
Accept Pipeline Input?
true (ByValue, ByPropertyName)
Accept Wildcard Characters?
false

-Path <String>

Path to the item to be analysed.
Aliases
Required?
true
Position?
1
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Id <String>

Id of the item to be analysed.
Aliases
Required?
true
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Database <String>

Database containing the item to be analysed - can work with Language parameter to narrow the publication scope.
Aliases
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

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
1
PS master:\> Get-ItemField -Path master:\content\home
2
3
Text
4
Title
5
Image
Copied!

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.
1
PS master:\> Get-Item master:\content\home | Get-ItemField -IncludeStandardFields -ReturnType Field -Name "*" | ft Name, DisplayName, SectionDisplayName, Description -auto
2
3
Name DisplayName SectionDisplayName Description
4
---- ----------- ------------------ -----------
5
__Revision Revision Statistics
6
__Standard values __Standard values Advanced
7
__Updated by Updated by Statistics
8
__Validate Button Validation Rules Validation Button Validation Rules Validation Rules
9
__Created Created Statistics
10
__Thumbnail Thumbnail Appearance
11
__Insert Rules Insert Rules Insert Options
12
__Short description Short description Help
13
__Created by Created by Statistics
14
__Presets Presets Layout
15
Text Text Data The text is the main content of the document.
Copied!

Related Topics

Last modified 2yr ago