how to run powershell commands in linux?

Raghavan August 27, 2018

need to run powershell command in linux. powershell core is installed but if i give pwsh as a command in the tasks, the process is not ending 

1 answer

0 votes
Edwin Kyalangalilwa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 30, 2018

Hi @Raghavan,

Please check if the folder housing pwsh is in your PATH.

Also, confirm the name - i'm seeing it installed in

/usr/bin/powershell
Raghavan August 30, 2018

yes, i have included the path as an executable in the tasks like /usr/bin/pwsh and try to using it in bamboo tasks.

Edwin Kyalangalilwa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 31, 2018

@Raghavan,

Try using a Bamboo script task instead

#!/usr/bin/env pwsh 

Write-Host "Using Powershell $($PSVersionTable.PSEdition) v$($PSVersionTable.PSVersion)"
Raghavan September 2, 2018

Thanks for the prompt reply..

 

however we are trying to run few powershell scripts using powershell core installed in amazon linux... any help is appreciated.

 

Thank you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events