Alias Bash inside Powershell

Powershell

Windows is my daily driver and I quite like using Powershell. One thing I wish I could do was just type in bash in the prompt and immediately switch over to Git Bash!

Instructions

Prerequisites: Make sure you have git-bash or another bash shell installed. You may have to update the executable path.

  1. Edit your Powershell profile and add the following line. You can find your profile location in the $PROFILE variable.
    function bash { & 'C:\Program Files\Git\bin\sh.exe' --login }
  2. Now every time you just type in bash your shell will super conveniently become bash!
Git Bash

Powershell may be powerful, but always need Bash at arms reach ;)

--

--