Skip to main content
New Copy Settings
Updated this week

Command

New-CopySettings

Description

The command to create the copy settings for a SharePoint migration.

Tip: To learn how to replicate your copy options from the app in PowerShell, see Copy options in PowerShell.

Index

Examples

Incremental Copy

$copysettings = New-CopySettings -OnContentItemExists IncrementalUpdate 
$srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite"
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"
$srcList = Get-List -Name "mysrclist" -Site $srcSite 
$dstList = Get-List -Name "mydstlist" -Site $dstSite 
Copy-Content -SourceList $srcList -DestinationList $dstList -CopySettings $copysettings  

Copy List with Custom Copy Settings

$copysettings = New-CopySettings -OnError Cancel -OnWarning Cancel -OnContentItemExists Skip -OnSiteObjectExists Skip -VersionOrModerationComment "Moderate by migration" 
$srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite"
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"
Copy-List -All -SourceSite $srcSite -DestinationSite $dstSite -CopySettings $copysettings  

Syntax

New-CopySettings[[-OnWarning] <OnWarningAction {Continue | Cancel}>]
[[-OnError] <OnErrorAction {Skip | SkipAllVersions | Cancel}>]
[[-OnSiteObjectExists] <OnSiteObjectExistsAction {Merge | Skip}>]
[[-OnContentItemExists] <OnContentItemExistsAction {Overwrite | Skip | Rename | IncrementalUpdate}>]
[[-VersionOrModerationComment] <String>]

Parameters

-OnContentItemExists <OnContentItemExistsAction>

Specifies the content item exists automation action.

Required?

False

Default value

Overwrite

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-OnError <OnErrorAction>

Specifies the error automation action.

Required?

False

Default value

Skip

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-OnSiteObjectExists <OnSiteObjectExistsAction>

Specifies the site object exists automation action.

Required?

False

Default value

Merge

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-OnWarning <OnWarningAction>

Specifies the warning automation action.

Required?

False

Default value

Continue

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-VersionOrModerationComment <String>

Specifies the version or moderation comment automation action.

Required?

False

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

Did this answer your question?