"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

nvokeCommandCommand

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

This widget could not be displayed.

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

 

Thanks,

Om

This widget could not be displayed.

No i didn't

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

84 views 0 1
Join discussion

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