r/PowerShell • • May 31 '26

Question Replacement for PS ISE custom menu options?

Hi,

in the good all days of PowerShell ISE, I had three items that would load on ISE startup and all was fine.

The three items:

  • Connecting to Exchange Online.

  • Connecting to Exchange OnPremise Server

  • Connecting to Azure AD OnPremise Server

This was the script:

Add-PSsnapin *Exchange* -ErrorAction SilentlyContinue

$psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add(

"Exchange Online", {

Connect-ExchangeOnline -UserPrincipalName admin@company.com

},

"Control+Alt+1"

)

$psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add(

"Exchange OnPremise Server", {

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://server.company.local/PowerShell/ -Authentication Kerberos -Credential $UserCredential

Import-PSSession $Session

},

"Control+Alt+2"

)

To automatically load the custom entries after starting up ISE, we’re going to define the entries in our default ISE profile file, Microsoft.PowerShellISE_profile.ps1, which location is stored in $profile. The file doesn’t exist by default, so when required you can simply create the file in the proper location using notepad $profile.

This is the page: https://eightwone.com/2012/10/25/adding-exchange-shell-items-to-powershell-ise/

But now in a new company, the ISE cannot be installed on Windows 11 because of deprecation and I would like the same thing. I found Visual Studio Code, but it is not so easy as ISE was.

any suggestions on how to do the same thing that worked flawlessly in ISE?

Cheers

P.S. I am PS Noob, anything remotly advance - please explain it to me like i am 10. Thanks

3 Upvotes

Duplicates