Import-SPWeb
匯入網站、清單或文件庫。
Syntax
Import-SPWeb
[-Identity] <SPWebPipeBind>
-Path <String>
[-ActivateSolutions]
[-AssignmentCollection <SPAssignmentCollection>]
[-Confirm]
[-Force]
[-HaltOnError]
[-HaltOnWarning]
[-IncludeUserCustomAction <SPIncludeUserCustomAction>]
[-IncludeUserSecurity]
[-NoFileCompression]
[-NoLogFile]
[-UpdateVersions <SPUpdateVersions>]
[-WhatIf]
[-PreserveDeletedUserMetadataReferences]
[<CommonParameters>]
Description
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
指定匯入目的地的 URL 或 GUID。
此類型必須是有效的 URL、GUID 或物件,例如格式為 https://server_name 的有效 URL,或格式為 1234-4567-5678a 的 GUID。
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 物件標示為已刪除,仍嘗試為專案填入 [作者 ('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 |