Tag Archive | Powershell

Powershell in sharepoint 2010

In 2007 we had stsadm to perform administrative task , though in 2010 they have official deprecated and removed support for several commands in stsadm it can be used in several occasions .However stsadm has been now replaced with Powershell , that i’m sure we will be using more in the coming days.

Powershell scripts are more faster , unlike stsadm they help us in accessing file system and registry . Handling powershell scripts are relatively easier , yet another advantage of using powershell is unlike stsadm you need not restart services after your wsp deployments. Though i’m a great fan of stsadm i like using powershell because of my above observations.

Some of the commands i have executed with powershell :

1.Install Solution
Add-SPSolution -LiteralPath  C:\krishna\MySolution.wsp

2.Deploy Solution
Install-SPSolution –Identity MySolution.wsp –WebApplication http://mysites

We can use -AllWebApplications , if not to limit our deployment to a single application.

3. Retract Solution
Uninstall-SPSolution –Identity MySolution.wsp –WebApplication http://mysites

4.Remove Solution
Remove-SPSolution –Identity MySolution.wsp

Use -SPUserSolution to perform any of the above said activities on the sandbox solutions for the respective site collections.

5.Activate Feature
Enable-SPFeature –Identity FeatureName–url http://mysites

6.Deactivate Feature
Disable-SPFeature –Identity FeatureName–url http://mysites