From 27bae495870d5a53351ba3f4e06bbf70a31c4901 Mon Sep 17 00:00:00 2001 From: Kitty Cat Date: Sun, 7 Jul 2024 16:31:22 -0400 Subject: [PATCH] pwsh: create proxy function for etsn to use SSHTransport by default --- pwsh/Microsoft.PowerShell_profile.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pwsh/Microsoft.PowerShell_profile.ps1 b/pwsh/Microsoft.PowerShell_profile.ps1 index 34f5073..f4a760b 100644 --- a/pwsh/Microsoft.PowerShell_profile.ps1 +++ b/pwsh/Microsoft.PowerShell_profile.ps1 @@ -23,3 +23,9 @@ function Update-OhMyPosh { # Set alias to vim to bypass batch file launcher, allows UNC editing Set-Alias -Name vim -Value 'C:\Program Files\Vim\vim90\vim.exe' + +# Debauchery to make Enter-PSSession do what I want it to do +$ETSN_MD = New-Object System.Management.Automation.CommandMetaData (Get-Command Microsoft.PowerShell.Core\Enter-PSSession) +$ETSN_MD.DefaultParameterSetName = "SSHHost" +"function Enter-PSSession { " + [System.Management.Automation.ProxyCommand]::Create($ETSN_MD) + " }" | Invoke-Expression +Remove-Variable ETSN_MD