Install-SPWebPartPack

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

Syntax

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

Description

This cmdlet contains more than one parameter set. You may only use parameters from one parameter set, and you may not combine parameters from different parameter sets. For more information about how to use parameter sets, see Cmdlet parameter sets.

Install-SPWebPartPack Cmdlet 會在本機伺服器陣列的 LiteralPath 參數位置安裝網頁元件套件。 網頁元件套件可以使用 WebApplication 參數安裝在特定 Web 應用程式中。 如果未指定 Web 應用程式,則會在所有 Web 應用程式中安裝網頁元件套件。

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

使用 GlobalInstall 參數將套件安裝到 GAC) (全域組件快取。 GAC 中的元件會被授與 FullTrust 許可權,讓此套件可以完整存取所有全系統資源。

使用 Force 參數來安裝套件,以覆寫任何具有相同名稱或安裝在相同位置的現有網頁元件套件。

如需適用於 SharePoint 產品的 Windows PowerShell 權限及最新資訊,請參閱線上文件 SharePoint Server Cmdlet

範例

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

Install-SPWebPartPack "MyCustomWebPartPack" -LiteralPath "C:\mywebpart.wpp" -GlobalInstall

本範例會從 c:/mywebpart.wpp 路徑,全域在伺服器陣列中安裝名稱為 MyCustomWebPartPack 的網頁元件套件。

參數

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-CompatibilityLevel

Specifies the version of templates to use when creating a new SPSite object. This value sets the initial CompatibilityLevel value for the site collection. When this parameter is not specified, the CompatibilityLevel will default to the highest possible version for the web application depending on the SiteCreationMode setting.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Confirm

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

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Force

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

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-GlobalInstall

Installs the Web Part package in the global assembly cache (GAC) rather than in the /bin directory of each Web application. This installation makes the Web Part globally accessible on the servers.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Language

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

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-LiteralPath

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

Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WebApplication

Specifies the Web application on which to install the Web Part pack. If no Web application is specified, the Web Part pack is installed on all Web applications.

Type:SPWebApplicationPipeBind
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-名稱

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

Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition