Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

No snap-ins have been registered for Windows PowerShell version 2.

$
0
0

Hi all,

I am trying to execute a power shell script from the Windows application. When power shell scripts gets executed, its showing following error message.

I am using below code to execute my power shell script

Process.Start("PowerShell.exe", "C:\\Applications\\PSscripts\\CreateMemberShipProvider.ps1");
Add-Snapin - No snap-ins have been registered for Windows PowerShell version 2.

My power shell scripts is having following commands:

Add-Type -Path 'c:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\ISAPI\Microsoft.SharePoint.Client.dll' 
Add-Type -Path 'c:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\ISAPI\Microsoft.SharePoint.Client.Runtime.dll'
Add-PsSnapin Microsoft.SharePoint.PowerShell
New-SPWeb –url http://sp2010dev1:3691/Site6 -name $args[0] -template STS#0 
New-SPWeb –url http://sp2010dev1:3691/Site7 -name $args[1] -template STS#0 

Any Suggestion ?




Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>