I have a bash script foo.sh and I want to execute it with some arguments --bar from PowerShell Core. This doesn't work:
./foo.sh
Use a & operator
& "./foo.sh"
Or execute it using bash
& bash "./foo.sh"
./foo.sh.& "./foo.sh" or ./foo.sh just opens foo.sh in the text editor on my system. To actually run the script I had to use: & bash "./foo.sh"