Copy-SPContentTypes

指定适用于从本地复制到 SharePoint Online (SPO) 环境的内容类型。

语法

Default (默认值)

Copy-SPContentTypes
    [-AssignmentCollection <SPAssignmentCollection>]
    [-AuthEndpoint <String>]
    -ContentTypeNames <String[]>
    -Credential <PSCredential>
    [-GraphApiEndPoint <String>]
    -LocalSiteUrl <Uri>
    -LocalTermStoreName <String>
    -RemoteSiteUrl <Uri>
    [<CommonParameters>]

说明

此 cmdlet 在 SharePoint Online 混合方案中用于将内容类型从本地场复制到 SharePoint Online。

示例

示例 1

Copy-SPContentTypes -LocalSiteUrl https://localsite/ -LocalTermStoreName "managed metadata service application proxy" -RemoteSiteUrl https://contoso.sharepoint.com/ -ContentTypeNames @("ContentTypeA", "ContentTypeB") -Credential (Get-Credential)

此示例将本地站点 https://localsite/ 上名为 ContentTypeA、ContentTypeB 的指定内容类型(其术语存储名为“托管元数据服务应用程序代理”)迁移到远程站点 https://contoso.sharepoint.com/的中心站点。 如果远程站点是中心站点,则迁移目标将是本身。

参数

-AssignmentCollection

适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。

注意:使用 Global 参数时,所有对象都包含在全局存储中。 If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

参数属性

类型:SPAssignmentCollection
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-AuthEndpoint

适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定要使用的 AuthEndpoint,但不能指定默认的 AuthEndpoint。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ContentTypeNames

适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定要迁移的内容类型名称。 可以是数组的形式。

参数属性

类型:

String[]

默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

-Credential

适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定目标 SharePoint Online 网站的管理员帐户凭据。

参数属性

类型:PSCredential
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

-GraphApiEndPoint

适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定要使用的 GraphApiEndpoint,但不能指定默认的。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-LocalSiteUrl

适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定迁移源。 可以是本地站点或本地中心站点。

参数属性

类型:Uri
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

-LocalTermStoreName

适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定本地站点的本地术语存储的名称。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

-RemoteSiteUrl

适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定迁移目标。 可以输入远程站点 URL 或远程中心站点 URL,这两者都将处理为中心站点 URL。

参数属性

类型:Uri
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters

输入

System.Uri

System.String System.String[] System.Management.Automation.PSCredential Microsoft.SharePoint.PowerShell.SPAssignmentCollection

输出

System.Object