How to remove a feature with PowerShell

Here are the PowerShell commands to remove a feature.

Step 1
Uninstall the feature.
Uninstall-SPSolution -identity “<WSP FileName>”
(For ex, Uninstall-SPSolution -identity “Deploy_Service_Requests_Lists.wsp”)

Step 2
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.

[tweetmeme only_single=”false”]
Advertisements

How to deploy a feature through PowerShell

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.

[tweetmeme only_single=”false”]

How to deploy a workflow through PowerShell

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>
(For ex,
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&#8221; )

[tweetmeme only_single=”false”]