tags: windows11 powershell

Git Bash installed:


PS C:\Users\kaau> dir 'C:\Program Files\Git'
    Directory: C:\Program Files\Git
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        2026-02-16   2:27 PM                bin
d-----        2026-02-16   2:32 PM                cmd
d-----        2026-02-16   2:32 PM                dev
d-----        2026-02-16   2:33 PM                etc
d-----        2026-03-30  10:17 AM                logs
d-----        2026-02-16   2:28 PM                mingw64
d-----        2026-02-16   2:27 PM                tmp
d-----        2026-03-05   3:42 PM                usr
-a----        2026-02-02   5:39 PM         138656 git-bash.exe
-a----        2026-02-02   5:39 PM         138128 git-cmd.exe
-a----        2026-02-02   5:59 PM          18765 LICENSE.txt
-a----        2026-02-02   5:59 PM         300037 ReleaseNotes.html
-a----        2026-02-16   2:32 PM        1792194 unins001.dat
-a----        2026-02-16   2:26 PM        4441856 unins001.exe
-a----        2026-02-16   2:32 PM          25388 unins001.msg
 

${PROFILE}:


PS C:\Users\kaau> echo ${PROFILE}
C:\Users\kaau\OneDrive - BMO Financial Group\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

Set-Location C:\Users\kaau

# Put Git tools first
$gitBin = "C:\Program Files\Git\usr\bin"
$env:PATH = "$gitBin;$env:PATH"

# Remove conflicting aliases
'rm','cp','mv','cat','ls','cd' | ForEach-Object {
    Remove-Item "Alias:$_" -ErrorAction SilentlyContinue
}

function cd {
    param(
        [Parameter(Position = 0)]
        $path
    )

    if (-not $path -or $path -eq '~') {
        Set-Location $HOME
        return
    }

    if ($path -eq '-') {
        Set-Location -
        return
    }

    Set-Location $path
}