SharePoint 2016 Managing Site collection WebPartPack (Real World example)
Introduction
This article is a sequence of real world examples of the using PowerShell in SharePoint 2016. In this article, we will discuss how we will use the PowerShell cmdlets to managing the Site Collection webPartPack in SharePoint. We will try to cover all the available cmdlets i.e. get, Install and Uninstall.
Scenario
KrossFarm SharePoint farm facing some issues with the RSwebpart After long troubleshooting they finally reach to this point to we have to uninstall and reinstall the RSwebPart. They already have the RSwebpart.cab file with them, which make their life easy.
Tasks
- Get the list of webparts Installed the farm
- Uninstall the RSwebpart from the farm
- Install the RSWebpart globally.
Get
Let's get the list of all Webpart pack installed. Run the Below PowerShell
Get-SPWebPartPack
The output will be like this, But you notice, this will only Name of the solution, ID, and Status of Deployment.
But If you run the below mentioned command, You will get complete detail of the each webpartpack.
Get-SPWebPartPack | select *
The output will be Like this.
Uninstall
Now we will uninstall the RSwebpart from the farm.Please run the command below.
Uninstall-SPWebPartPack -Identity rswebparts.cab
Install
Finally, we will install the RSweb Part.Please run the below mentioned command.
Install-SPWebPartPack -LiteralPath "C:\Tempfiles\RSWebParts.cab" -GlobalInstall
This will deploy the RSwebpart globally (gacassembly) and to all web applications in the farm.
But if you just want to install it to only specific web applications, then run the below command.
Install-SPWebPartPack -LiteralPath "C:\Tempfiles\RSWebParts.cab" -WebApplication http://kfsp:9101
Note
I just use this as an example, the situation varies in your environment. this example is just for learning the purpose and give you an idea how to use commands.