We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a09049 commit fbbed5cCopy full SHA for fbbed5c
src/Common/Commands.Common.Test/Mocks/MockCommandRuntime.cs
@@ -102,7 +102,18 @@ public void WriteError(ErrorRecord errorRecord)
102
103
public void WriteObject(object sendToPipeline, bool enumerateCollection)
104
{
105
- OutputPipeline.Add(sendToPipeline);
+ System.Collections.IEnumerable enumerable = LanguagePrimitives.GetEnumerable(sendToPipeline);
106
+ if (enumerable != null && enumerateCollection)
107
+ {
108
+ foreach (object o in enumerable)
109
110
+ OutputPipeline.Add(o);
111
+ }
112
113
+ else
114
115
+ OutputPipeline.Add(sendToPipeline);
116
117
}
118
119
public void WriteObject(object sendToPipeline)
0 commit comments