The PowerShell Integrated Scripting Environment (ISE) is a great tool for writing, testing and debugging scripts. Since I don’t use the ISE exclusively for Exchange scripting, I don’t really need to import the EMS cmdlets everytime I start the ISE. So, I added a custom item to the ISE tools menu that I can use to import the Exchange Management Shell cmdlets whenever it is convenient. To do this, add the following code to your ISE-specific profile (for example: Microsoft.PowerShellISE_profile.ps1). Change the server name to use one of your Exchange 2010 servers:

$psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add(
  "Connect to Exchange",
    {
        $s = New-PSSession -ConfigurationName Microsoft.Exchange `
        -ConnectionUri http://adatum-ex1.adatum.com/PowerShell/ `
        -Authentication Kerberos

        Import-PSSession $s
    },
  "Control+Alt+Z"
)

If you don’t want to hard code the server name, you can replace the code in the script block in the with the code from this post. It will import the cmdlets from a random Exchange server in the local AD site.

After you reload your profile or restart the ISE, you’ll have a new item under the Add-Ons menu:

Click on Connect to Exchange, or use the keyboard shortcut Ctrl+Alt+Z (you can change this). When the code executes, the Exchange Management Shell cmdlets will be imported using implicit remoting:

At this point, you are ready to start running Exchange Mangement Shell commands in the ISE. Of course, if you’re not looking to do anything fancy you can just load the EMS cmdlets in your ISE-specific profile (there is an example of how to load EMS cmdlets from a profile with implicit remoting in this post) but I thought this was kind of a cool tip. If you haven’t worked with the ISE much and want to learn more about it, check out the ISE Help on TechNet.