3

I am using Windows Server 2008 R2 with SharePoint 2010.

I see two PowerShell tools on this machine: Windows PowerShell and the SharePoint 2010 Management Shell.

Does anyone know the difference? Can I use both for deployments of wsp files?

RJ Cuthbertson
  • 8,342
  • 6
  • 38
  • 76
Ola
  • 4,405
  • 26
  • 129
  • 231
  • This was the solution:

    http://sharepoint.stackexchange.com/questions/53953/suddenly-getting-the-local-farm-is-not-accessible-cmdlets-with-featuredependen

    – Ola Feb 22 '13 at 12:40

1 Answers1

2

The SharePoint 2010 Management Shell is an instance of PowerShell that already has the SharePoint PSSnapIn loaded. You can use either to deploy SharePoint .wsp solution packages.

Prefacing your script with:

if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) 
{
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}

will ensure that it will run from either shell instance.

RJ Cuthbertson
  • 8,342
  • 6
  • 38
  • 76
  • there is also windows powershell modules. I have test some deployment commando's and it works. why there are many types powershells? – Ola Feb 21 '13 at 23:03