"Invoke-Command " in powershell script doesn't work when invoke it from bamboo task only

"Invoke-Command " in powershell script doesn't work from bamboo plan invocation.

I have a script task (Run as Powershell script) that invoce powershell file with some parameter.

And magik is that it failed on line when i try to Invoke-Command -ComputerName ... on remote host with credentils previously created. Code powershell like this:


$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($ServiceUser,(ConvertTo-SecureString -String $ServicePassword -AsPlainText -Force))

Invoke-Command -ComputerName $serverName -ArgumentList $force,$WebAppPoolName,$ManagedRunTimeVersion -Credential $cred -ScriptBlock {

some actions .... }


And bamboo task is failed with error:

5:05 Invoke-Command : An internal error occurred.
04-Dec-2013 20:45:05 At C:\build-dir\QOIP-QI-JOB1\CIAF\Bamboo\PS\ConfigureIIS.ps1:56 char:15
04-Dec-2013 20:45:05 + Invoke-Command <<<< -ComputerName $serverName -ArgumentList $force,$WebAppPo
04-Dec-2013 20:45:05 olName,$ManagedRunTimeVersion -Credential $cred -ScriptBlock {
04-Dec-2013 20:45:05 + CategoryInfo : InvalidOperation: (:) [Invoke-Command], PSInvali
04-Dec-2013 20:45:05 dOperationException
04-Dec-2013 20:45:05 + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.I
04-Dec-2013 20:45:05


But magik is that when i run the same powershell scrip on bamboo instance manualy with the same parameters and under the same "Bamboo" user i didn't recived such error and this script work correctly.

So this issue reproduced only when try to run powershel stuff by bamboo and for command Invoke-Command when trying to do something on remote host under appropriate permissions.

Any suggestion how to fix this issue ?

2 answers

Did you found the solution for this? I am having the same issue.




No i didn't

Suggest an answer

Log in or Sign up to answer
Community showcase
Asked Dec 06, 2018 in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

5,676 views 22 17
View question

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you