Sharepoint 2010 – Basic Powershell Commands

Below are the basics for installing sharepoint 2010 webparts using powershell.

 

  1. Open “Sharepoint 2010 Management Shell”
    image
  2. Add-SPSolution c:\wsps\contactus.wsp
  3. install-spsolution –identity contactus.wsp –webapplication http://moss-server –GACDeployment

    note: –GACDeployment is required if you are deploying to the assembly
  4. To update an existing web part you can run the following line
    Update-SPSolution –Identity SharePointProject2.wsp –LiteralPath c:\wsps/contactus.wsp –GACDeployment

Dont forget to activate your feature!

 

You can also add the following line to your ps1 files:

Add-PSSnapin “Microsoft.SharePoint.PowerShell”

This prevents the need for using SharePoint 2010 Management Shell. Just use normal powershell.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: