New-Item c:\ofi -ItemType Directory -ea 0 if (!(Test-Path C:\ofi\PortableGit\git-bash.exe)) { if (!(Test-Path c:\ofi\PortableGit.7z.exe)) { echo "Please wait while downloading..." Invoke-WebRequest -Uri "https://github.com/git-for-windows/git/releases/download/v2.44.0.windows.1/PortableGit-2.44.0-64-bit.7z.exe" -OutFile c:\ofi\PortableGit.7z.exe } else { echo "Portable git Installer is already downloaded" } echo "Please click OK to install Git-Bash" cd c:\ofi Invoke-Expression .\PortableGit.7z.exe } else { echo "Git Bash already installed!" } if (!(Test-Path "$env:USERPROFILE\.bashrc")) { echo "alias notepad='/c/Program Files/Notepad++/notepad++.exe'" | out-file "$env:USERPROFILE\.bashrc" -encoding ASCII echo "alias python='winpty /c/Programme/Anaconda/python.exe'" | out-file "$env:USERPROFILE\.bashrc" -encoding ASCII -Append echo "Created .bashrc with aliases for notepad and python" } else { echo "~/.bashrc already exists, not touching it..." } Invoke-Expression C:\ofi\PortableGit\git-bash.exe