Skip to content

Instantly share code, notes, and snippets.

@573
Last active August 19, 2024 10:25
Show Gist options
  • Save 573/61d9170c74629040493916125374e23b to your computer and use it in GitHub Desktop.
Save 573/61d9170c74629040493916125374e23b to your computer and use it in GitHub Desktop.
permanent Alias with pwsh not powershell

Permanent Alias with pwsh.exe not powershell.exe, see https://stackoverflow.com/questions/24914589/how-to-create-permanent-powershell-aliases#comment126572792_29806921

steps:

$ cd $env:USERPROFILE\Documents
$ md PowerShell -ErrorAction SilentlyContinue
$ cd PowerShell
$ New-Item Microsoft.PowerShell_profile.ps1 -ItemType "file" -ErrorAction SilentlyContinue
$ powershell_ise.exe .\Microsoft.PowerShell_profile.ps1

add ie

function Do-ActualThing {
    & "C:\Users\dkahlenberg\scoop\apps\git\current\bin\bash.exe" --login -i @Args
}

Set-Alias bash Do-ActualThing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment