I used to have a PowerShell ISE profile that added three custom menu items and keyboard shortcuts for connecting to Exchange Online, an on-premises Exchange server, and an on-premises Azure AD server. The profile used commands such as Connect-ExchangeOnline, New-PSSession with Kerberos authentication, Import-PSSession, and Enter-PSSession.
PowerShell ISE is no longer available for installation on Windows 11 because it has been deprecated. I would like to recreate the same convenient workflow in Visual Studio Code, but I am still a beginner and find VS Code less straightforward than ISE. Can I use a PowerShell profile, tasks, snippets, or another simple feature to create clickable commands or shortcuts for these connection scripts? Please explain the setup in beginner-friendly terms.
5 Answers
A simple option is to define functions in your profile, such as Connect-MyExchangeOnline and Connect-MyOnPremExchange, instead of trying to recreate ISE menu entries. Each function can contain the connection commands from your old script. Windows Terminal can also be configured with separate PowerShell profiles if you want different shortcuts or startup commands.
PowerShell profiles work in VS Code too; they are not limited to ISE. First install the official PowerShell extension, then open a PowerShell terminal in VS Code and run $PROFILE to see which profile file is being used. Create that file if necessary and place your functions or connection commands there. You can then run those functions from the terminal whenever you need them.
If the old menu items were mainly shortcuts for running commands, you can use VS Code tasks instead. Tasks let you assign a name and keybinding to a script or command. If you only need reusable blocks of text inserted into a script, PowerShell snippets are a better fit. Since your commands actually connect to servers, profile functions or tasks will probably be more useful than snippets.
You do not necessarily need startup menu items. Put each connection sequence in a small script or function and run it when required. PowerShell's command history and PSReadLine also make repeated commands easier to recall, so you do not have to type the entire command every time. For the on-premises connections, keep using Get-Credential and make sure the session and authentication settings match your environment.
VS Code has a mode and set of instructions specifically intended to make the transition from PowerShell ISE easier. It explains how to configure the editor, terminal, script pane, keybindings, and other features so the workflow feels more familiar. That is probably the best starting point for reproducing the ISE experience.

Thanks, that helps. I will use the profile approach and may need some extra guidance while I learn VS Code.