1
.\g

Automating a daily powershell git routine.

As the default mode doesn't allow ps scripts to be executed we need to allow at least locally created scripts.

  1. Open Powershell as admin, execute this line and confirm with y.
1
Set-ExecutionPolicy RemoteSigned
  1. Write your script i.e. a git routine as I use it to update my git repo for this website. Save this file as g.ps1 in your working directory.
1
2
3
4
git add . 
git commit -m "quick commit"
git push origin master
Write-Host "Done"
  1. Execute your ps script

When you are in your working diectory type and enter

1
.\g