I develop on Windows. And somehow got into the habit of using both the powershell and the git bash. It's not clear cut, but generally speaking i use git bash for small tasks and moving around the file system. When writing longer scripts i tend to use powershell.
This week i stumbled about a nice way to execute a powershell script from the bash. This helps to reduce context switches.
You have to use the following Statement
$ powershell -File scriptToRun.ps1
When you use an alias it gets even more convinient
$ alias ps1='powershell -File'
$ ps1 scriptToRun.ps1
Addition
Another way to run powershell scripts was suggested by a reader in the comments.
❗ First you have to make sure that the powershell.exe is on the path.
Then add the following shebang line at the start of your script:
#!/usr/bin/env pwsh
"Hello world!"
$ ./helloWorld.ps1
Hello world!
Thank you again @vitalytseshkovsky!