Import-SPWeb
导入 Web、列表或库。
语法
Import-SPWeb
[-Identity] <SPWebPipeBind>
-Path <String>
[-ActivateSolutions]
[-AssignmentCollection <SPAssignmentCollection>]
[-Confirm]
[-Force]
[-HaltOnError]
[-HaltOnWarning]
[-IncludeUserCustomAction <SPIncludeUserCustomAction>]
[-IncludeUserSecurity]
[-NoFileCompression]
[-NoLogFile]
[-UpdateVersions <SPUpdateVersions>]
[-WhatIf]
[-PreserveDeletedUserMetadataReferences]
[<CommonParameters>]
说明
Import-SPWeb cmdlet 可导入 Web、列表或库。 从库导入功能是 SharePoint 产品中的一项新功能。
有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet。
示例
---------------------示例----------------------
Import-SPWeb https://site -Path export.cmp -UpdateVersions Overwrite
此示例将 export.cmp 的内容导入到网站 https://site,使用 export.cmp 文件的内容覆盖网站上已进行版本管理的内容。
参数
-ActivateSolutions
指定是否在导入时激活用户解决方案。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-AssignmentCollection
管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。
在使用 Global 参数时,所有对象均包含在全局存储中。 如果未立即使用对象,或未通过使用 Stop-SPAssignment 命令来处理对象,则可能会发生内存不足的情况。
Type: | SPAssignmentCollection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Confirm
执行命令前,看到确认提示。
有关详细信息,请键入以下命令:get-help about_commonparameters
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Force
此参数在此 cmdlet 中没有函数。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-HaltOnError
出现错误时停止导入过程。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-HaltOnWarning
出现警告时停止导入过程。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Identity
指定要导入到的 Web 的 URL 或 GUID。
键入的值必须是有效的 URL、GUID 或对象;例如,有效的 URL 形式为 https://server_name,或 GUID 的形式为 1234-4567-5678a。
Type: | SPWebPipeBind |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-IncludeUserCustomAction
指定导入期间是否包括用户自定义操作。
有效值包含:
全部、无
Type: | SPIncludeUserCustomAction |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-IncludeUserSecurity
保留用户安全设置。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-NoFileCompression
启用或禁用导入包中的文件压缩。 导入包存储在 Path 参数或 Identity 参数指定的文件夹中。 出于性能方面的考虑,建议您使用此参数。 如果启用压缩,则导入过程的速度可提高大约 30%。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-NoLogFile
取消生成导入日志文件。 如果此参数不存在,则 Import-SPWeb cmdlet 将在导出包所在的位置生成一个导出日志文件。 该日志文件使用统一日志记录服务 (ULS)。
建议您使用此参数。 但是,为提高性能,您可能不想生成日志文件。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Path
指定导入文件的名称。
如果使用了 NoFileCompression 参数,则必须指定目录;否则,任何文件格式都有效。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-PreserveDeletedUserMetadataReferences
即使 SPUser 对象在目标网站上被标记为已删除,也会尝试为项计算“Author” (“Created By”) 字段。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-UpdateVersions
指示如何解决要导入到网站的文件在该网站中已存在的情况。 如果不存在 UpdateVersions 参数,则导入操作默认使用值 1 (Append) 。
必须为下列类型之一:
-Append,它将新版本添加到当前文件
-覆盖文件及其所有版本 (删除,然后插入)
-如果目标上存在文件,则忽略该文件
默认值为“向当前文件添加新版本”。
有效值包含:
追加、忽略、覆盖
Type: | SPUpdateVersions |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-WhatIf
显示一条描述命令作用的消息,而不执行命令。
有关详细信息,请键入以下命令:get-help about_commonparameters
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |