How to Permanently Add Exchange 2013 PowerShell Cmdlets to PowerShell ISE
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.
- 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.
- 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.
- Enter the command test-path $profile. This will either return a True or a False.
- 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} - 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.
- 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
- 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.
THX. Works great. 🙂
Thanks, finally ISE with the Powershell.
Great! Thank you.