From 1e7b981de400c7138b956518639134f6f80997f6 Mon Sep 17 00:00:00 2001 From: Kitty Cat Date: Thu, 14 Nov 2024 03:18:29 -0500 Subject: [PATCH] powershell: add config --- powershell/Microsoft.PowerShell_profile.ps1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 powershell/Microsoft.PowerShell_profile.ps1 diff --git a/powershell/Microsoft.PowerShell_profile.ps1 b/powershell/Microsoft.PowerShell_profile.ps1 new file mode 100644 index 0000000..a4f19b2 --- /dev/null +++ b/powershell/Microsoft.PowerShell_profile.ps1 @@ -0,0 +1,14 @@ +# Shortcut to edit the hosts file +function hosts { + Start-Process "notepad.exe" -Args "C:\Windows\system32\drivers\etc\hosts" -Verb runAs +} +# Set alias to vim to bypass batch file launcher, allows UNC editing +Set-Alias -Name vim -Value 'C:\Program Files\Vim\vim91\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 + +Invoke-Expression (&starship init powershell)