How do I execute a Git command through a PowerShell script?
Turns out the answer is fairly straight forward, wrap the command in a loop forever. This'll allow you to Ctrl-C out of it, and it'll keep repeating even after your command completes or otherwise exits the first time.
Check that git is accessible from PowerShell by executing git --version from PowerShell. If git is not recognized as the name of a command, verify that you have Git installed. If not, install Git from https://git-scm.com. If you have Git installed, make sure the path to git is in your PATH environment variable.
Install Git for Windows, and make sure to put Git/bin folder in your Windows path variable.
Here is a good link to make your experience of Git and PowerShell better:
Make PowerShell, SSH GitHub and Git suck less on Windows
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With