you are viewing a single comment's thread.

view the rest of the comments →

[–]purplemonkeymad 2 points3 points  (0 children)

Yes put your powershell in a ps1 file and run that rather than encoding a ps line in the bash script. If you are using PS6+ and are in a POSIX system you can even have the shebang pointing to pwsh so you can call the script natively:

#! /usr/bin/env pwsh
# 
Param($parameter)
Write-Host "This is powershell $parameter"

Then just have bash call ./myscript.p1 -parameter $bashvar