SharpeRAD / Cake.Powershell

Powershell addin for Cake
http://cakebuild.net
MIT License
83 stars 36 forks source link

System.Management.Automation.RemoteException: Program 'install.cmd' failed to execute: Remote host method get_BufferSize is not implemented. #27

Closed Rookian closed 7 years ago

Rookian commented 7 years ago

When we execute our cake script on the build agent manually everything works fine. But if run the release (cake script) with TFS Agent we get an error:

Remote host method get_BufferSize is not implemented

Code:

var resultCollection = StartPowershellFile("C:/Temp/" + uniqueId + "/install.cmd", new PowershellSettings()
{
   ComputerName = host,
   FormatOutput = false,
   LogOutput = false
});

Script output:

Executing: &"C:/Temp/235965f0-6120-4d10-92d2-c4da228b8fc4/install.cmd"

2017-05-29T10:58:36.1929591Z Fehler: 1,System.Management.Automation.RemoteException: Program 'install.cmd' failed to execute: Remote host method get_BufferSize is not implemented.

2017-05-29T10:58:36.1929591Z At line:1 char:2

2017-05-29T10:58:36.1929591Z + & <<<< "C:/Temp/235965f0-6120-4d10-92d2-c4da228b8fc4/install.cmd".

2017-05-29T10:58:36.1929591Z An error occurred when executing task 'Default'.

Current workaround (hard coded):

var command = "Invoke-Command -ComputerName XYZ -ScriptBlock { &'C:\\Temp\\f55f6f92-1bbc-4a23-85ac-e020bbaaaf69\\install.cmd' }";
StartProcess("powershell", new ProcessSettings { Arguments = "-Command \"" + command + "\"" });

Any ideas on what is going on here?

SharpeRAD commented 7 years ago

settings.OutputToAppConsole = false;

When the environment doesn't support console outputting.