Import-SPAppPackage

导入应用程序包。

语法

Import-SPAppPackage
      -Path <String>
      -Source <SPAppSource>
      [-AssignmentCollection <SPAssignmentCollection>]
      [-Confirm]
      [-WhatIf]
      [-AssetId <String>]
      [-ContentMarket <String>]
      -Site <SPSitePipeBind>
      [<CommonParameters>]

说明

使用 Import-SPAppPackage cmdlet 可从内容数据库导入应用程序包,并使用 SiteCollection 参数在网站集中创建应用程序。

有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet

示例

-----------示例----------

Import-SPAppPackage -Path .\feature-upgrade-v1.spapp -Site https://localhost -Source ([microsoft.sharepoint.administration.spappsource]::ObjectModel)

此示例导入应用程序包。

参数

-AssetId

指定要导入的资产 ID。

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

-Confirm

Prompts you for confirmation before executing the command. For more information, type the following command: 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

-ContentMarket

指定内容市场的名称。

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

-Path

指定输入文件的路径。

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

-Site

指定要导入的 SPSite 对象。

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

-Source

定义应用程序的来源。 源指示应用包的来源,例如,如果应用是由开发人员生成的,但不驻留在 SharePoint 市场,则可以使用 CorporateCatalog 源。

有效值如下:

InvalidSource、Marketplace、CorporateCatalog、DeveloperSite、ObjectModel、RemoteObjectModel

下面是有效的源 (不是应用的 -Source) 参数:

--SharePoint Store (市场)

--App catalog (CorporateCatalog)

--SharePointService - 指示使用 SharePoint 功能就地构建的应用,例如 Access Services (ObjectModel)

Type:SPAppSource
Position:Named
Default value:None
Accept pipeline input:False
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

-工作分配

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