In this tutorial, How to call git bash command from Powershell. For example git bash content to split CSV file on windows :
Call git bash command from powershell
K:/TEST/split.sh
cd $1
echo split start
date
pwd
split Filetest.CSV Filetest -l 20000000 -d
ls -l
for filename in $1/*; do
wc -l $filename
done
date
echo split end
exit
Powershell content:
$TOOL_PATH = "K:/TEST"
$FOLDER_PATHS = "K: / TEST / INPUT"
$COMMAND = "bash.exe" + " " + $TOOL_PATH + "/split.sh"
echo $COMMAND
Invoke-Expression $COMMAND
Add C:\Program Files\Git\bin into PATH environment
OK!
Thank you for reading the DevopsRoles page!