Here are the PowerShell commands to remove a feature.
Uninstall the feature.
Uninstall-SPSolution -identity “<WSP FileName>”
(For ex, Uninstall-SPSolution -identity “Deploy_Service_Requests_Lists.wsp”)
Remove the solution.
Remove-SPSolution -identity “<WSP FileName>”
(For ex, Remove-SPSolution -identity “Deploy_Service_Requests_Lists.wsp”)
* Note pay attention to SPSoluion (farm solution) vs SPUserSolution (sandboxed solution). You need what kind of solution you deployed to know which command to use.
Here is the link to install a feature.
Every time I go to deploy a feature from outside Visual Studio I forget the PowerShell commands.
I found the Corey Roth has a great blog entry about it and I end up going there.
So I decided to finally write up what I do. After using stsadmin for so long it’s hard to make the adjustment to PowerShell.
Here is the first step to add a Farm Solution.
Add-SPSolution <File Path>\<WSP Filename>
(For ex, Add-SPSolution C:\Users\Administrator\Desktop\Deploy\Deploy_Service_Lists.wsp)
The next step is to install the solution.
Install-SPSolution –Identity <WSP Filename> p –GACDeployment
(For ex, Install-SPSolution –Identity Deploy_Service_Requests_Lists.wsp –GACDeployment)
*If you use Add-SPUserSolution it will be sandboxed solution. Which I’ve done before at a client and I couldn’t find the solution because I used the wrong command.
** Workflows are a little different because they are not scoped at the farm level. Here is the link to deploy a workflow.
Every time I go to deploy a workflow from outside Visual Studio I forget the PowerShell commands.
So I decided to finally write up what I do. Here’s what I do.
Step 1 add the solution.
Add-SPSolution –LiteralPath <FILEPATH\WSP FileName> –Site <URL>
Add-SPSolution -LiteralPath C:\Users\Administrator\Desktop\Deploy\Service_Request_Workflow.wsp -Site http://win-ate30fn6vk5 )
Step 2 install the solution.
Install-SPSolution –Identity <WSP FileName> –Site “<URL>”
(For ex, Install-SPSolution –Identity Service_Request_Workflow.wsp -Site “http://win-ate30fn6vk5” )
If you notice the following error in the event, there is a simple fix.
The Execute method of job definition Microsoft.Office.Server.Administration.ApplicationServerAdministrationServiceJob (ID c7f87cbb-e67d-44a2-9061-5321094aa81e) threw an exception. More information is included below.
Open Com Services and check the permissions on OSearch and IIS Admin Services.
The WPG group need to have permissions on Local Launch and Local Activate.
If your web app just can’t tolerate a user clicking the back button, you can tell the browser to not cache the page. Most of the time it will listen if you use this code, which covers all the bases:
Response.Expires = 60
Response.ExpiresAbsolute = DateAdd(DateInterval.Day, -1, Now())
Response.CacheControl = “no-cache”