query:
or fast:
is required. May return more than 1 item.Get-Item
and Get-ChildItem
.Initialize-Item
command. We'll show an example of this later./sitecore
portion of the path is unnecessary. This is because the Sitecore item is represented by the root item of the drive master:
and is therefore optional.-Language
and -Version
parameters. You may have also noticed that the forward and backward slashes can be used interchangeably.en-US
at its third version.en-*
. The use of that filter would return all items in the English language, ignoring the region.Get-ChildItem
. This is especially true if you need to work on large trees but need to select only a few items (e.g. a specific template). For this we’ve introduced support for the Sitecore query within our provider.Important to note that the query format sometimes requires the use of a#
before and after paths when they contain reserved keywords or spaces.
Select-Object
.Sitecore.Data.Fields.ImageField
.._
and .PSFields
to gain access to the typed field.Sitecore.Data.Fields.LinkField
. From there you can see all of the available properties.TextField
s and outputs to the console.Set-ItemProperty
and the other is more natural to a Sitecore developer.Set-ItemProperty
..Editing.BeginEdit
and .Editing.EndEdit
methods.System.DateTime
typed value from a field rather than the System.String
Sitecore stores internally.System.DateTime
value to the PowerShell automated property..Editing.BeginEdit
and .Editing.EndEdit
. This method can be applied for a variety of field types such as GeneralLink and Image./sitecore/content/
item to the ItemList field.$item.Editing.BeginEdit()
and $item.Editing.EndEdit()
every time which results in saving the item after every assignment. Assigning multiple properties on an item this way might be detrimental to the performance of your script. In such cases you might want to call $item.Editing.BeginEdit()
yourself before modifying the item. Subsequently call the $item["field name"] = "new value"
for each property modify. Finally end with the $item.Editing.EndEdit()
.Sitecore.Data.BulkUpdateContext
technique.Sitecore.Data.BulkUpdateContext
.New-UsingBlock
command creates a new closure, you need to return the data to use in a different scope.New-UsingBlock
function:Sitecore.SecurityModel.SecurityDisabler
Sitecore.Data.BulkUpdateContext
Sitecore.Globalization.LanguageSwitcher
Sitecore.Sites.SiteContextSwitcher
Sitecore.Data.DatabaseSwitcher
Sitecore.Security.Accounts.UserSwitcher
Sitecore.Data.Items.EditContext
Sitecore.Data.Proxies.ProxyDisabler
Sitecore.Data.DatabaseCacheDisabler
Sitecore.Data.Events.EventDisabler
Copy-Item
command will likely meet the need.New-Item
command was passed to Format-Table -Autosize
to improve the formatting.