Update-ItemReferrer

Updates references to specified item to point to a new provided in the -NewTarget or removes links to the item.

Syntax

Update-ItemReferrer [-Link] <ItemLink> [-NewTarget] <Item>

Update-ItemReferrer [-Link] <ItemLink> -RemoveLink

Update-ItemReferrer [-NewTarget] <Item> [-Item] <Item>

Update-ItemReferrer -NewTarget <Item> -Path <String> [-Language <String[]>]

Update-ItemReferrer -NewTarget <Item> -Id <String> [-Database <String>] [-Language <String[]>]

Update-ItemReferrer -RemoveLink [-Item] <Item>

Update-ItemReferrer -RemoveLink -Path <String> [-Language <String[]>]

Update-ItemReferrer -RemoveLink -Id <String> [-Database <String>] [-Language <String[]>]

Detailed Description

The cmdlet manipulates link to a specific item. The target item can be provided as an Item object or through Path/ID. it does not modifies the item itself but rather other items that link to it. If the -RemoveLink parameter is used the link will be removed rather than modified. To deliver more fine grained filtering you can provide ItemLink using the -Link parameter. You can obtain ItemLinks using Get-ItemReferrer or Get-ItemReference cmdlets. Consult Examples for specific use cases of each approach.

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

Parameters

ItemLink retrieved from the Link database. Use this parameter to do more granular filtering.

Aliases

Required?

true

Position?

1

Default Value

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-NewTarget <Item>

New item the links should be pointing to

Aliases

Required?

true

Position?

2

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

If provided, removes all links to the current target item.

Aliases

Required?

true

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Item <Item>

The current item to be relinked.

Aliases

Required?

true

Position?

1

Default Value

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Path <String>

Path to the current item to be relinked - can work with Language parameter to narrow the publication scope.

Aliases

Required?

true

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Id <String>

Id of the current item to be relinked - can work with Language parameter to specify the language other than current session language. Requires the Database parameter to be specified.

Aliases

Required?

true

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Database <String>

Database containing the current item to be relinked.

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Language <String[]>

If you need the current item to be relinked in specific Language You can specify it with this parameter. Globbing/wildcard supported.

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

Notes

Help Author: Adam Najmanowicz, Michael West

Examples

EXAMPLE 1

This example covers global operations

Assuming Sitecore PowerShell Extensions 4.2 or newer is installed Assuming your Home has an "Image" field of type "Image" Assuming you have second item next to Home called Home2 that has an "Image" field of type "Image"

EXAMPLE 2

This example covers more fine-grained filtered approach to removing links

Assuming Sitecore PowerShell Extensions 4.2 or newer is installed Assuming your Home has an "Image" field of type "Image" Assuming you have second item next to Home called Home2 that has an "Image" field of type "Image"

EXAMPLE 3

This example covers more fine-grained filtered approach to removing links

Assuming Sitecore PowerShell Extensions 4.2 or newer is installed Assuming your Home has an "Image" field of type "Image" Assuming you have second item next to Home called Home2 that has an "Image" field of type "Image"

Last updated