We have the command line command here, which starts the PowerShell remoting session.
#Windows terminal vs powershell windows
"icon": "C:/Users/thoma/Downloads/AzureVMIcon32.png"Īs you can see, we define the profile name and the tab title in for the Windows Terminal entry. "commandline": "pwsh.exe -NoProfile -NoExit -Command Enter-PSSession -ComputerName .com -Credential thomas", In my case, I will add two to different menu items, once I am going to do a PowerShell remoting session to an Azure VM using Windows PowerShell and in the other, I am going to use PowerShell 7. To add new “menu items,” you will need to add a profile to the profiles array in the JSON file. This will open up a settings.json file, which you can edit in your favorite editor, for example, Visual Studio Code. To get started, we need to open up the settings of the Windows Terminal. Add a PowerShell Remote Session in Windows Terminal Tab However, this would work with every other machine which you can access using PowerShell Remoting.
Scott Hanselman wrote a great blog post on how you can add tabs to open an SSH connection directly, so why not do the same thing with PowerShell? In my example, I will add a tab in Windows Terminal, which opens up a PowerShell remoting session (using WS-Management WSMan) to an Azure virtual machine (VM).
The new Windows Terminal is highly customizable and it allows you to run different shells like the classic command prompt, Windows PowerShell, PowerShell 7, and also Windows Subsystem for Linux shells (I am using, for example, Ubuntu with the Windows Subsystem for Linux 2 (WSL 2)). In this blog post, I want to share how you can add a PowerShell remote session to the drop-down menu in the Windows Terminal when you open a new tab.
I am sure you have heard about the new Windows Terminal, which is in preview, and you can get it from the Windows Store.