Open Geolle opened 4 years ago
I wrote this in my cake script
var collection= StartPowershellFile("C:\\Project\\Spacebuilder\\greenblue.ps1", new PowershellSettings() { ComputerName = config.Server.ServerName, Username = config.Server.UserName, Password = config.Server.Password, FormatOutput = true, LogOutput = true }); foreach (var item in collection) { Information("Result: {0}", item.BaseObject.ToString()); }
It returns Result: 0 but there is no output. if I use scripts below
Result: 0
StartPowershellScript("echo \"111\"", new PowershellSettings() { ComputerName = config.Server.ServerName, Username = config.Server.UserName, Password = config.Server.Password, FormatOutput = true, LogOutput = true });
it is ok and returns 111 or if I read the greenblue.ps1 into a string and execute through StartPowershellScript it also works Why?
111
greenblue.ps1
StartPowershellScript
This is the output from cake
Executing: echo "111" 111 Executing: &"C:/Project/Spacebuilder/greenblue.ps1" Result: 0
I wrote this in my cake script
It returns
Result: 0
but there is no output. if I use scripts belowit is ok and returns
111
or if I read thegreenblue.ps1
into a string and execute throughStartPowershellScript
it also works Why?