14 February 2017

Load Exchange 2013 PowerShell Cmdlets when starting PowerShell ISE everytime

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

And you can add some other's ofcourse:
Import-Module IsePackV2 -Force

No comments:

Post a Comment