New-ItemClone

Last updated last month

Creates a new item clone based on the item provided.

Syntax

New-ItemClone [-Item] <Item> -Destination <Item> [-Name <String>] [-Recurse]

New-ItemClone [-Path] <String> -Destination <Item> [-Name <String>] [-Recurse]

New-ItemClone -Id <String> [-Database <String>] -Destination <Item> [-Name <String>] [-Recurse]

Detailed Description

Creates a new item clone based on the item provided.

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

Parameters

-Destination <Item>

Parent item under which the clone should be created.

Aliases

Required?

true

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name <String>

Name of the item clone.

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Recurse <SwitchParameter>

Add the parameter to clone thw whole branch rather than a single item.

Aliases

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Item <Item>

The item to be cloned.

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 cloned.

Aliases

Required?

true

Position?

1

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Id <String>

Id of the item to be cloned

Aliases

Required?

true

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Database <String>

Database of the item to be cloned if item is specified through its ID.

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

Notes

Help Author: Adam Najmanowicz, Michael West

Examples

EXAMPLE

Clone /sitecore/content/home/ under /sitecore/content/new-target/ with the "New Home" name.

PS master:\> $newTarget = Get-Item master:\content\new-target\
PS master:\> New-ItemClone -Path master:\content\home -Destination $newTarget -Name "New Home"

Related Topics