nerdexam
Microsoft

70-332 · Question #106

You deploy SharePoint Server 2013. You need to install a SharePoint hosted app named App1 in a site. Which Windows PowerShell cmdlet should you run?

The correct answer is B. Import-SPAppPackage and then run Install-SPApp. Installing a SharePoint-hosted app via PowerShell requires first importing the app package and then installing it to a specific site using two distinct cmdlets.

Configure and manage SharePoint environment

Question

You deploy SharePoint Server 2013. You need to install a SharePoint hosted app named App1 in a site. Which Windows PowerShell cmdlet should you run?

Options

  • AInstall-SPSolution and then run Add-SPSolution
  • BImport-SPAppPackage and then run Install-SPApp
  • CAdd-SPSolution and then run Install-SPApp
  • DInstall-SPAppPackage and then run Import-SPApp

How the community answered

(34 responses)
  • B
    94% (32)
  • C
    3% (1)
  • D
    3% (1)

Why each option

Installing a SharePoint-hosted app via PowerShell requires first importing the app package and then installing it to a specific site using two distinct cmdlets.

AInstall-SPSolution and then run Add-SPSolution

Install-SPSolution and Add-SPSolution are cmdlets for the legacy farm solution (WSP) deployment model and have no role in the SharePoint app model.

BImport-SPAppPackage and then run Install-SPAppCorrect

Import-SPAppPackage registers the app package in the farm's app catalog, making it available for deployment to site collections. Install-SPApp then deploys that imported app to a target site, completing the two-step installation process. These are the correct, designated cmdlets for the SharePoint app model and follow the documented PowerShell workflow for SharePoint-hosted apps.

CAdd-SPSolution and then run Install-SPApp

Add-SPSolution is part of the farm solution pipeline, not the app model, so pairing it with Install-SPApp combines two incompatible deployment frameworks.

DInstall-SPAppPackage and then run Import-SPApp

Install-SPAppPackage and Import-SPApp do not exist as valid SharePoint PowerShell cmdlets and would result in an error if run.

Concept tested: SharePoint 2013 PowerShell app installation cmdlets

Source: https://learn.microsoft.com/en-us/powershell/module/sharepoint-server/import-spapppackage

Topics

#app deployment#PowerShell#Import-SPAppPackage#Install-SPApp

Community Discussion

No community discussion yet for this question.

Full 70-332 Practice