Creating a simple Windows Powershell shortcut
.\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.
- Open Powershell as admin, execute this line and confirm with y.
Set-ExecutionPolicy RemoteSigned
- 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.
git add .
git commit -m "quick commit"
git push origin master
Write-Host "Done"
- Execute your ps script
When you are in your working diectory type and enter
.\g