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.
Question
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)- B94% (32)
- C3% (1)
- D3% (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.
Install-SPSolution and Add-SPSolution are cmdlets for the legacy farm solution (WSP) deployment model and have no role in the SharePoint app model.
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.
Add-SPSolution is part of the farm solution pipeline, not the app model, so pairing it with Install-SPApp combines two incompatible deployment frameworks.
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
Community Discussion
No community discussion yet for this question.