Alexander's Blog

Sharing knowledge with the global IT community since November 1, 2004

How to Permanently Add Exchange 2013 PowerShell Cmdlets to PowerShell ISE

/
/
ad-mania

You can permanently register the Exchange PowerShell commands into PowerShell ISE so you don’t always have to manually add the command Add-PSsnapin *Exchange* -ErrorAction SilentlyContinue every time you start PowerShell ISE. Here’s the step-by-step procedure.

  1. Activate PowerShell Integrated Scripting Environment (ISE). By default, PowerShell ISE is installed in Windows Server 2008/R2 but not activated. To activate it you can use the Add Features wizard in Server Manager. In Windows Server 2012/R2 it is already installed and activated. The reason I prefer PowerShell ISE over PowerShell is because it is a much nicer interface and offers a multi-line editor plus additional help for scripting.
  2. Start PowerShell ISE with an account that has administrative privileges.CAUTION: Make sure that you start Windows PowerShell ISE, which is 64-bit, rather than Windows PowerShell ISE (x86) which is 32-bit.

    PowerShell_ISE_64bit

    PowerShellStartingScreen 

  1. Enter the command test-path $profile. This will either return a True or a False.
  2. If it returns False then you can create a profile for yourself using the following command.
    if (!(test-path $profile)) {new-item -type file -path $profile -force}
  3. The path to the profile is provided, e.g. C:\Users\SP_Admin\Documents\WindowsPowerShell. The name of the file is also provided, e.g. Microsoft.PowerShellISE_profile.ps1.PS_profile_info
  4. Open the .ps1 file in Notepad. The file will be blank. Enter the following command and then save the file (File, Save). Make sure that the file is saved with the original .PS1 extension and not .txt.
    Add-PSsnapin *Exchange* -ErrorAction SilentlyContinue
  5. Close and restart the PowerShell ISE. Your Exchange PowerShell cmdlets should now be available to you. Verify this by typing any Exchange PowerShell cmdlet. For example type the following command.
    Get-ExchangeServer | fl name,edition,admindisplayversion

Copyright ©2014 Zubair Alexander. All rights reserved.

  • Facebook
  • Twitter
  • Linkedin

3 Comments

Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar