Skip to content

Commit 306c142

Browse files
author
Hovsep Mkrtchyan
committed
Giving better formatting to Powershell test execution.
1 parent c1f11c5 commit 306c142

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Common/Commands.ScenarioTests.Common/EnvironmentSetupHelper.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,15 @@ public virtual Collection<PSObject> RunPowerShellTest(params string[] scripts)
293293
if (powershell.Streams.Error.Count > 0)
294294
{
295295
var sb = new StringBuilder();
296+
297+
sb.AppendLine("Test failed due to a non-empty error stream, check the error stream in the test log for more details.");
298+
sb.AppendLine(string.Format("{0} total Errors", powershell.Streams.Error.Count));
296299
foreach (var error in powershell.Streams.Error)
297300
{
298-
sb.AppendLine(error.ErrorDetails.Message);
301+
sb.AppendLine(error.Exception.ToString());
299302
}
300303

301-
throw new RuntimeException(
302-
"Test failed due to a non-empty error stream, check the error stream in the test log for more details.\r\n" +
303-
sb.ToString());
304+
throw new RuntimeException(sb.ToString());
304305
}
305306

306307
return output;

0 commit comments

Comments
 (0)