|
1 |
| -# New-ISERemoteTab |
| 1 | +# ISERemoteTab |
| 2 | + |
| 3 | + |
2 | 4 |
|
3 | 5 | The module includes a PowerShell function to add new remote tabs in the PowerShell ISE. The default behavior of adding remote tabs in the ISE is very basic and offers no flexibility like specifying an alternate port. This module was created to address those limitations.
|
4 | 6 |
|
5 | 7 | This command will create one or more remote tabs in the PowerShell ISE. You could use this to programmatically to open multiple remote tabs.
|
6 | 8 |
|
7 |
| - PS C:\> New-ISERemoteTab -Computername $c -Credential globomantics\administrator -Authentication Default |
| 9 | +After importing the module into the ISE be sure to read help and examples. All commands must be run in the PowerShell ISE. |
| 10 | + |
| 11 | +## Basic Usage |
| 12 | + |
| 13 | +The default behavior is to open tabs with your current credentials using [New-ISEREmoteTab](docs/New-ISERemoteTab.md). |
| 14 | + |
| 15 | +```powershell |
| 16 | +New-ISERemotetab localhost |
| 17 | +``` |
| 18 | + |
| 19 | +But you can specify a single credential for all remote connections, or prompt for a credential for each connection. You might need this if some of the machines require different credentials. |
| 20 | + |
| 21 | +```powershell |
| 22 | +New-ISERemoteTab -Computername $c -Credential company\administrator -Authentication Default |
| 23 | +``` |
| 24 | + |
| 25 | +You can also specify a VMName to use PowerShell Direct and connect to a Hyper-V virtual machine. You will need to include parameters with this option. |
| 26 | + |
| 27 | +```powershell |
| 28 | +New-ISEREmoteTab -vmname srv1 -credential $admin |
| 29 | +``` |
| 30 | + |
| 31 | +The original function was first demonstrated at <http://bit.ly/1lpMoNj>. |
| 32 | + |
| 33 | +## Form Front-End |
| 34 | + |
| 35 | +The module also includes a second function ([New-ISEREmoteTabForm](docs/New-ISERemoteTabForm.md)) to generate a WPF form to enter remote tab information. You can enter a single computer or multiple names separated by commas. |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +The form should handle everything except additional PSSessionOptions. If you require that level of control, you will need to use `New-ISEREmoteTab`. If you check the box for `Use VMName`, incompatible form controls will be disabled. |
| 40 | + |
| 41 | +_You will need to manually close the form._ |
| 42 | + |
| 43 | +## Profile Scripts |
| 44 | + |
| 45 | +Normally, you do not have a traditional PowerShell profile script when you enter a remote PSSession. But you have the option to specify a profile script that will be executed in the remote session in place of a regular profile script. The form will look in your current session for a variable called `ISERemoteProfile` which is the path to a ps1 file with your remote profile script. |
8 | 46 |
|
9 |
| -The default behavior is to open tabs with your current credentials. But you can specify a single credential for all remote connections, or prompt for a credential for each connection. You might need this if some of the machines require different credentials. |
| 47 | +You can set this in your PowerShell ISE Profile script or you can use the `Save script setting` checkbox to store the current file in the variable. |
10 | 48 |
|
11 |
| -The original function is described in greater detail at http://bit.ly/1lpMoNj. |
| 49 | +Note that this variable is only for the length of your PowerShell session and does NOT update your ISE profile. In your PowerShell ISE profile script you can add lines like this to create a menu shortcut and define a default remote profile script: |
12 | 50 |
|
13 |
| -This version of the module includes a second function (New-ISERemoteForm) to generate a WPF form to enter remote tab information. |
14 |
| -You can enter a single computer or multiple names separated by commas. |
| 51 | +```powershell |
| 52 | +Import-Module ISERemoteTab |
15 | 53 |
|
16 |
| - |
| 54 | +$Display = "New Remote ISE Tab" |
| 55 | +$Action = {New-ISEREmoteForm} |
| 56 | +$Shortcut = "Ctrl+Shift+T" |
| 57 | +$ISERemoteProfile = "C:\Scripts\RemoteProfile.ps1" |
17 | 58 |
|
18 |
| -In your PowerShell ISE profile script you can add lines like this to create a menu shortcut: |
| 59 | +$psise.CurrentPowerShellTab.AddOnsMenu.Submenus.Add($Display,$Action,$shortcut) | Out-Null |
| 60 | +``` |
19 | 61 |
|
20 |
| - Import-Module ISERemoteTab |
| 62 | +A sample profile script, [SampleRemoteProfile.ps1](SampleRemoteProfile.ps1), is included with this module. |
21 | 63 |
|
22 |
| - $Display = "New Remote ISE Tab" |
23 |
| - $Action = {New-ISEREmoteForm} |
24 |
| - $Shortcut = "Ctrl+Shift+T" |
25 |
| - $ISERemoteProfile = "C:\Scripts\RemoteProfile.ps1" |
| 64 | +## Deprecation Notice |
26 | 65 |
|
27 |
| - $psise.CurrentPowerShellTab.AddOnsMenu.Submenus.Add($Display,$Action,$shortcut) | Out-Null |
| 66 | +This module should be considered in maintenance-mode. The PowerShell ISE should be considered deprecated. I will try to address bug fixes, but do not expect any other changes or enhancements to this module. If you like the concept of separate remoting sessions, you can achieve similar results with [Windows Terminal](https://docs.microsoft.com/en-us/windows/terminal/get-started). |
28 | 67 |
|
29 |
| -After importing the module into the ISE be sure to read help and examples. |
|
0 commit comments