Get-Item
Gets Sitecore items from the specified drive.

Syntax

1
Get-Item [-Path] <String[]> [-ID <ID>] [-Language <String[]>] [-Version <String>] [<CommonParameters>]
2
3
Get-Item [-Path] <String[]> [-Query <String>] [-Language <String[]>] [-Version <String>] [-AmbiguousPaths] [<CommonParameters>]
4
5
Get-Item [-Path] <String[]> [-Uri <String>] [-Language <String[]>] [-Version <String>] [<CommonParameters>]
6
7
Get-Item [-Path] <String[]> [-Database <String>] [-Language <String[]>] [-Version <String>] [<CommonParameters>]
Copied!

Detailed Description

The Get-Item command unlocks the item.
© 2010-2019 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions

Parameters

-Path <String>

The path to the item. If the Database parameter is not provided, the path should include the database. For example, "master:\content\home".
Aliases
Text
Required?
true
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-ID <ID>

The unique identifier for the item.
Aliases
Text
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Query <String>

The Sitecore query or fast query to retrieve the item.
Aliases
Text
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Item <Item>

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

-Path <String>

Path to the item to be processed - can work with Language parameter to specify the language other than current session language.
Aliases
Text
Required?
true
Position?
1
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Id <String>

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

-Database <String>

Database containing the item to be fetched with Id parameter.
Aliases
Text
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Language <Language[]>

Language(s) to use for filtering items.
Aliases
Text
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false

-Version <String>

Version number to use for filtering items.
Aliases
Text
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. Should be the path to an item.
  • System.String

Outputs

The output type is the type of the objects that the cmdlet emits.
  • Sitecore.Data.Items.Item

Notes

Help Author: Adam Najmanowicz, Michael West

Examples

EXAMPLE 1

The following gets the item using the path.
1
Get-Item -Path "master:\content\home"
Copied!

EXAMPLE 2

The following gets all items in the master database, located under Content, which are based on the template Sample Item using a Sitecore query.
1
Get-Item -Path "master:" -Query "/sitecore/content//*[@@templatename='Sample Item']"
Copied!

EXAMPLE 3

The following gets the item in the master database with the specified ID.
1
Get-Item -Path "master:" -ID "{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}"
Copied!

EXAMPLE 4

The following gets the item in the master database using the Uri.
1
Get-Item -Path "master:" -Uri "sitecore://master/{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}?lang=en&ver=1"
Copied!

Related Topics

  • Get-ChildItem
Last modified 9d ago