Install-SPWebPartPack

 

適用版本: SharePoint Foundation 2010, SharePoint Server 2010

上次修改主題的時間: 2015-03-09

將指定的網頁組件套件安裝在指定的位置。

Syntax

Install-SPWebPartPack [-LiteralPath] <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-GlobalInstall <SwitchParameter>] [-Language <UInt32>] [-WebApplication <SPWebApplicationPipeBind>] [-WhatIf [<SwitchParameter>]]

Install-SPWebPartPack [-Name] <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-GlobalInstall <SwitchParameter>] [-Language <UInt32>] [-WebApplication <SPWebApplicationPipeBind>] [-WhatIf [<SwitchParameter>]]

詳細描述

Install-SPWebPartPack Cmdlet 會將位於 LiteralPath 參數位置的網頁組件套件,安裝在本機伺服器陣列中。使用 WebApplication 參數,可將網頁組件套件安裝在特定的 Web 應用程式中。若不指定 Web 應用程式,網頁組件套件即會安裝在所有的 Web 應用程式中。

使用 Language 參數可指定套件語言。

使用 GlobalInstall 參數可將套件安裝至全域組件快取 (GAC) 中。會授與 GAC 中組件 FullTrust 權限,賦予此套件整個系統的完整存取權。

使用 Force 參數可安裝套件,以覆寫所有現有的同名網頁組件套件,或安裝在相同位置的網頁組件套件。

Parameters

參數 必要 類型 描述

LiteralPath

必要

System.String

指定網頁組件套件的正確路徑。

Name

必要

System.String

指定要安裝的網頁組件套件名稱。

AssignmentCollection

選用

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

為能適當處置物件而管理物件。使用 SPWebSPSite 等物件可能會耗用大量的記憶體,因此在 Windows PowerShell 指令碼中使用這些物件時,必須適當地管理記憶體。您可以使用 SPAssignment 物件將物件指派給變數,並在不需要時處置這些物件,以釋放記憶體。使用 SPWebSPSiteSPSiteAdministration 物件時,若未使用指派集合或 Global 參數,將會自動處置這些物件。

注意

使用 Global 參數時,所有物件會包含在全域儲存區內。若未立即使用物件,或未使用 Stop-SPAssignment 命令處置物件,將會發生記憶體不足的狀況。

Confirm

選用

System.Management.Automation.SwitchParameter

執行命令之前,會先提示您進行確認。如需詳細資訊,請輸入下列命令:get-help about_commonparameters

Force

選用

System.Management.Automation.SwitchParameter

覆寫所有現有的同名網頁組件套件,或安裝在相同位置的網頁組件套件。

GlobalInstall

選用

System.Management.Automation.SwitchParameter

將網頁組件套件安裝在全域組件快取 (GAC) 中,而不是安裝在每個 Web 應用程式的 /bin 目錄中。此種安裝方式使網頁組件在各伺服器上成為可全域存取的項目。

Language

選用

System.UInt32

指定網頁組件套件的語言識別碼。

WebApplication

選用

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

指定網頁組件套件安裝所在的 Web 應用程式。若不指定任何 Web 應用程式,網頁組件套件即會安裝在所有的 Web 應用程式中。

WhatIf

選用

System.Management.Automation.SwitchParameter

顯示訊息描述命令效果,而非描述命令執行的效果。如需詳細資訊,請輸入下列命令:get-help about_commonparameters

輸入類型

傳回類型

Example

------------------範例------------------

Install-SPWebPartPack "MyCustomWebPartPack" -LiteralPath "c:/mywebpart.wpp" -GlobalInstall

此範例會將名為 MyCustomWebPartPack 的網頁組件套件全域安裝於路徑 c:/mywebpart.wpp 下的伺服器陣列。

See Also

Reference

Uninstall-SPWebPartPack
Get-SPWebPartPack