Tuesday, February 1, 2011

How to enable Powershell’s Integrated scripting environment for running Sharepoint 2010

Run following commands on powershell
Import-Module ServerManager; Add-WindowsFeature PowerShell-ISE
Search for server manager and add this feature as follows

Configuring ISE for sharepoint
• Copy or type the following text in the Command Pane (View > Go to Command Pane) and press ENTER:

# Creates a local user PowerShell ISE profile

if (!(test-path $profile ))

{new-item -type file -path $profile -force}

# opens it for edit

psEdit $profile

• Running these commands will open a new script file in the Script Pane. Type the following commands in the script file and save it by clicking the Save button on the toolbar:

# Copy the following into the new file and save it

cd 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration'


cd \

From now on, the SharePoint cmdlets will automatically load every time you start Windows PowerShell ISE as the same user. If you are still having problems using it, you may need to run it as an Administrator by right-clicking the shortcut and selecting Run as administrator (you can also force it to run as an administrator every time by right-clicking the shortcut, selecting Properties and then the Advanced button).

No comments: