Way back before the days of PowerShell Core, or even VS Code for that matter, the PowerShell ISE was the center of my PowerShell world. I spent a lot of time finding ways to make it easier for me to use and to push it to its limits. Naturally, the PowerShell ISE doesn't play much of a role for me these days. But that may not be true for you. In fact, one area where the ISE can be useful is with remote sessions. You could easily open PowerShell remoting sessions in separate tabs. Need to have open sessions to a handful of servers? The ISE gives you a single interface. The potential challenge is that the ISE didn't give you any control over setting up a remote session. So years ago I wrote a module, ISERemoteTab, to add some of the missing functionality. I hadn't touched it in years until someone reached out with a problem with the module. They used the module daily and I realized there is still value in the ISE as a remoting interface so I dusted off the code and polished it up.
ManageEngine ADManager Plus - Download Free Trial
Exclusive offer on ADManager Plus for US and UK regions. Claim now!
PowerShell Direct
One of the updates I was always planning was support for PowerShell Direct. This lets you connect to a Hyper-V virtual machine over the VMBus and not the network interface. Invoke-Command has a -VMName parameter you can use in place of the -Computername parameter.
New-ISERemoteTab -VMName win10 -Credential company\artd -ProfileScript C:\scripts\RemoteProfile.ps1
The command has a parameter to let you specify a local script that can be treated as a profile script in the remote session. In my example, the profile script displays a summary and defines a prompt.
Updated Entry Form
I also updated the module command that generates a WPF form that you can use to easily enter values for a new PowerShell remoting session.
If you check the "Use VMName" box, all the settings that apply to the Computername parameter are disabled.
You can enter multiple computer names to open multiple remote tabs at the same time. Or select a different WSMan configuration endpoint.
I've now connected to the PowerShell 7 endpoint.
Note that this is using the WSMan endpoint and not SSH as you can in PowerShell 7. I am unlikely to modify this module any further other than serious bugs. Long term, I'm working on something using Windows Terminal that will support PowerShell 7. The PowerShell ISE is a Windows PowerShell tool that doesn't really support PowerShell 7.
Your Turn
If this intrigues you, first checkout the module's README file. Then install the module from the PowerShell Gallery in a Windows PowerShell session. Open the PowerShell ISE, import the ISERemoteTab module, and start connecting. Have fun.
1 thought on “Using the PowerShell ISE as a Remote Management Console”
Comments are closed.