How to call git bash command from powershell

Example git bash content to split csv file on windows :

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 enviroment

OK !

,

About Dang Nhu Hieu

I'm Vietnamese. In the past, I'm a software developer, now working in Japan on an Infra team. Skill : AWS, VMware, HA architech,setting Database : Oracle DB, PostgresDB ,.. Programming language : Java, C#, Python, Bash linux, Batch windows, powershell ,... Hobbies: badminton, film photo, travel. My instagram:https://www.instagram.com/dangnhuhieu/
View all posts by Dang Nhu Hieu →

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment moderation is enabled. Your comment may take some time to appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.