Friday, 11 April 2014

Configure ISE in SharePoint Server



The Windows PowerShell Integrated Scripting Environment (ISE) is a host application for Windows PowerShell. In Windows PowerShell ISE,

  • You can run commands and write, test, and debug scripts in a single Windows-based graphic user interface with multiline editing, tab completion, syntax coloring, selective execution, context-sensitive help, and support for right-to-left languages.
  •  You can use menu items and keyboard shortcuts to perform many of the same tasks that you would perform in the Windows PowerShell console.  For example, when you debug a script in the Windows PowerShell ISE, to set a line breakpoint in a script, right-click the line of code, and then click Toggle Breakpoint. 
  •  PowerShell is a great companion for SharePoint 2010 and 2013. As a developer or Administrator you can go through the Integrated Scripting Environment (ISE) to write scripting in best way. The only problem is, the SharePoint snap-in doesn't load automatically when you start PowerShell ISE.

Below are the steps to get ISE installed and make sure the SharePoint snap-in always loads.

1. Open Server Manager
2. Click the Features node
3. Click the Add Features link
4. Check the box for "Windows PowerShell Integrated Scripting Environment".
5. Click Next, then Install
6. Wait until installation is complete
7. Open Powershell ISE from Programs>Accessories>PowerShell folder
8. Run the following code from the immediate window in ISE to create a new profile for all users
 if (!(test-path $profile.AllUsersAllHosts))

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

9. Run the following code to edit the new profile
psEdit $profile.AllUsersAllHosts
10. When profile1.ps1 opens, add the following code to attach the SharePoint snap-in every time PowerShell is run.
 If ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )

{ Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell }
 11. Save profile.ps1 and close PowerShell ISE.
12. Start PowerShell ISE again and type the following command to verify that the SharePoint snap-in loaded. You should see SharePoint-specific command listed.

Get-Command Get-SP*


Reference: http://technet.microsoft.com/en-us/library

No comments:

Post a Comment