DEV Community


Posted on • Updated on


Execute a powershell script from inside the git bash

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
Enter fullscreen mode Exit fullscreen mode

When you use an alias it gets even more convinient

$ alias ps='powershell -File'
$ ps scriptToRun.ps1
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git