Skip to content

Commit 907dee8

Browse files
v2.0.0
1 parent 1be5ff5 commit 907dee8

16 files changed

+1339
-945
lines changed

ISERemoteTab.psd1

-4.16 KB
Binary file not shown.

ISERemoteTab.psm1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#requires -version 4.0
2-
3-
. $psScriptroot\New-ISERemoteTab.ps1
4-
. $psScriptroot\New-ISERemoteTabForm.ps1
5-
1+
2+
#dot source the module functions
3+
. $psScriptroot\Functions\New-ISERemoteTab.ps1
4+
. $psScriptroot\Functions\New-ISERemoteTabForm.ps1

New-ISERemoteTab.ps1

Lines changed: 0 additions & 220 deletions
This file was deleted.

README.md

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,67 @@
1-
# New-ISERemoteTab
1+
# ISERemoteTab
2+
3+
![PSGallery Version](https://img.shields.io/powershellgallery/v/ISERemoteTab.png?style=for-the-badge&logo=powershell&label=PowerShell%20Gallery)![PSGallery Downloads](https://img.shields.io/powershellgallery/dt/ISERemoteTab.png?style=for-the-badge&label=Downloads)
24

35
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.
46

57
This command will create one or more remote tabs in the PowerShell ISE. You could use this to programmatically to open multiple remote tabs.
68

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+
![Remote ISE Tab](images/remoteIsetab_thumb.png "Remote Tab Form")
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.
846

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.
1048

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:
1250

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
1553
16-
![Alt Remote ISE Tab](http://jdhitsolutions.com/blog/wp-content/uploads/2016/05/remoteIsetab_thumb.png "Remote Tab Form")
54+
$Display = "New Remote ISE Tab"
55+
$Action = {New-ISEREmoteForm}
56+
$Shortcut = "Ctrl+Shift+T"
57+
$ISERemoteProfile = "C:\Scripts\RemoteProfile.ps1"
1758
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+
```
1961

20-
Import-Module ISERemoteTab
62+
A sample profile script, [SampleRemoteProfile.ps1](SampleRemoteProfile.ps1), is included with this module.
2163

22-
$Display = "New Remote ISE Tab"
23-
$Action = {New-ISEREmoteForm}
24-
$Shortcut = "Ctrl+Shift+T"
25-
$ISERemoteProfile = "C:\Scripts\RemoteProfile.ps1"
64+
## Deprecation Notice
2665

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).
2867

29-
After importing the module into the ISE be sure to read help and examples.

SampleRemoteProfile.ps1

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
#this is a sample remote profile script
2-
#each command must be a one-liner. Do not use block comments.
2+
3+
#how long has this session been running?
4+
$initiated = Get-Date
5+
6+
Function prompt {
7+
#display the session runtime without the milliseconds
8+
$ts = ((Get-Date) - $initiated).ToString().split(".")[0]
9+
# Write-Host ">$ts< " -ForegroundColor yellow -nonewline
10+
Write-Host "$ts <REMOTE> " -NoNewline -ForegroundColor Red -BackgroundColor Yellow
11+
"PS $($executionContext.SessionState.Path.CurrentLocation)--> "
12+
}
13+
314
Set-Location -path 'C:\'
415
Clear-Host
516

17+
Write-Host "Connected to " -nonewline
18+
Write-Host "$env:Computername" -ForegroundColor Red -BackgroundColor Yellow -NoNewline
19+
Write-Host " as $($env:userdomain)\$($env:username)"
20+
621
$PSVersionTable
722

changelog.md

5.81 KB

Changelog for ISERemoteTab

  • Updated License.
  • Modified New-ISERemoteTab to better support profiles so that prompt functions can be defined. Issue #10.
  • Changed the -Profile parameter in New-ISERemoteTab to -ProfileScript to avoid potential conflicts with the automatic $Profile variable. This also required an update to New-ISERemoteTabForm.
  • Updated commands to support PowerShell Direct and connecting to a Hyper-V virtual machine. Issue #9.
  • Added the nrtf alias for New-ISERemoteTabForm.
  • Removed the cred and c aliases for the Credential parameter in New-ISERemoteTab.
  • Removed code in New-ISERemoteTab to run Test-WSMan.
  • Added better error handling in New-ISERemoteTab.
  • Removed user name in New-ISERemoteTab when prompting for credential.
  • Reorganized module layout.
  • Updated SampleRemoteProfile.ps1 with a demo prompt function.
  • Increased the required Windows PowerShell version to 5.1.
  • Help updates.
  • Updated README.md.

v1.5.1

  • Updated author name in manifest

v1.5.0

  • Modified New-ISERemoteTab to clear the host if not using a profile.
  • Update markdown help documents
  • Updated XML help file
  • increased module version number
  • created external help files

v1.4.2

  • Fixed Issue #6 setting default focus to computername text box.
  • Fixed Issue #5 to save remote profile script setting.
  • Trimmed extra spaces in labels and elements.
  • Minor tweaks to form layout.
  • Added version number to form
  • Fixed Issue #7 that prevented session options from working

v1.4.1

  • Modified New-ISERemoteTabForm to include a browse button for the remote profile script. Issue #4

v1.4

  • Revised help
  • Fixed a bug with the Test-WSMan code that was including the ConfigurationName parameter.
  • Added New-ISERemoteTabForm.ps1
  • Renamed and converted to a module.
  • Published to the PowerShell Gallery

v1.3

  • revised help documentation
  • Added code to run Test-WSMan prior to creating a remote tab to verify computer is accessible
  • Added parameter to specify a local script with commands to be executed remotely upon startup
  • Added #Requires statement to require the ISE module which should restrict this command to the ISE
  • Added parameter validation attributes from other session related cmdlets
  • Added None to validation set for Authentication

v1.2

  • Added additional remoting parameters
  • Updated help
  • fixed minor bug testing for and deleting temporary credential file

v1.1

  • Added MIT License

v1.0

  • Initial release

changelog.txt

-3.47 KB
Binary file not shown.

docs/ISERemoteTab.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ Locale: en-US
66
---
77

88
# ISERemoteTab Module
9+
910
## Description
11+
1012
A PowerShell ISE module to make it easier to create remote tabs.
1113

1214
## ISERemoteTab Cmdlets
15+
1316
### [New-ISERemoteTab](New-ISERemoteTab.md)
17+
1418
This function will let you create remote tabs in the ISE that supports many of the same parameters you would get with Enter-PSSession.
1519

1620
### [New-ISERemoteForm](New-ISERemoteForm.md)
17-
This function creates a WPF entry form that serves as a front end to New-ISERemoteTab.
18-
19-
20-
21-
2221

22+
This function creates a WPF entry form that serves as a front end to New-ISERemoteTab.

0 commit comments

Comments
 (0)