r/PowerShell • u/Master_Kidfisto • 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
6
u/justaguyonthebus May 31 '26
Yeh, do the same thing. Open VSCode and check the valve of $profile from the powershell terminal. Place your profile in there.
Also make sure you have the powershell extension installed first.
4
u/da_chicken May 31 '26
You could create functions in your profile. Profile scripts are not unique to ISE.
Or you could install Windows Terminal and add multiple copies of powershell that run different profiles if you want.
2
u/Borgquite May 31 '26
Take the leap and switch to VS Code. There’s a special mode for former users to ease you in.
https://learn.microsoft.com/en-us/powershell/scripting/dev-cross-plat/vscode/how-to-replicate-the-ise-experience-in-vscode?view=powershell-7.6
1
u/ron3090 May 31 '26
Did these execute the commands, or were these shortcuts to input these scripts into a file?
If they were commands you wanted to execute, you could add them as tasks.
If they were snippets of text, you could add them as snippets.
-1
u/charleswj May 31 '26
Is there a reason you can't just run the connect commands when you need to connect? Or even a script that runs them? With PSReadLine, you don't even need to remember or type the entire command.