SharePoint Development Blog

Nick Boumans
View my LinkedIn Profile Follow me on Twitter View my Profile on FaceBook View my projects on CodePlex View my presentations on SlideShare



Recent posts

Tags

Categories

Navigation

Pages

Archive

Blogroll

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Adding and Deploying Solutions with PowerShell in SharePoint 2010

Visual Studio 2010 makes it really easy to add and deploy solutions when you are developing (the F5 experience), but you may eventually want to deploy those solution packages elsewhere then on your development machine. We can still use the stsadm tool, but that is effectively considered deprecated now in favor of PowerShell.

To get started with PowerShell, run the SharePoint 2010 Management Console located in your Microsoft SharePoint 2010 Products folder on your start menu. This automatically loads the Microsoft.SharePoint.PowerShell snappin so that we can execute SharePoint commands.

 


[code:xml]


Add-SPSolution c:\codefolder\SharePointSolution.wsp
Install-SPSolution –Identity SharePointSolution.wsp –WebApplication http://yoursharepointurl -GACDeployment
Update-SPSolution –Identity SharePointSolution.wsp –LiteralPath  c:\codefolder\SharePointSolution.wsp –GACDeployment
Uninstall-SPSolution –Identity SharePointSolution.wsp –WebApplication http://yoursharepointurl
Remove-SPSolution –Identity SharePointSolution.wsp

Also cool is getting your SharePoint version by using Powershell

function global:Get-SPFarm
{
       return [Microsoft.SharePoint.Administration.SPFarm]::Local
}
$farm = Get-SPFarm
$farm.BuildVersion

The result looks like

Major  Minor  Build  Revision
-----  -----  -----  --------
14     0      4536   1000
Posted: Dec 30 2009, 12:32 by Nick Boumans | Comments (0) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5