File tree Expand file tree Collapse file tree 2 files changed +38
-3
lines changed
Microsoft.CLU/System.Management.Automation Expand file tree Collapse file tree 2 files changed +38
-3
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+ using System . Threading . Tasks ;
5
+
6
+ using System . Management . Automation ;
7
+
8
+ namespace Microsoft . CLU . Test
9
+ {
10
+ [ Cmdlet ( VerbsCommon . New , "String" ) ]
11
+ public class StringGenerator : PSCmdlet
12
+ {
13
+ public StringGenerator ( )
14
+ {
15
+ Count = 10 ;
16
+ StringFormat = "String {0}" ;
17
+ }
18
+
19
+ [ Parameter ( ) ]
20
+ public int Count { get ; set ; }
21
+
22
+ [ Parameter ( ) ]
23
+ public string StringFormat { get ; set ; }
24
+
25
+ protected override void ProcessRecord ( )
26
+ {
27
+ base . ProcessRecord ( ) ;
28
+ for ( int i = 1 ; i <= Count ; ++ i )
29
+ {
30
+ WriteObject ( String . Format ( StringFormat , i ) ) ;
31
+ }
32
+ }
33
+
34
+ }
35
+ }
Original file line number Diff line number Diff line change @@ -142,11 +142,11 @@ internal void FlushPipeline(LocalPackage package)
142
142
formattedType = obj . GetType ( ) ;
143
143
if ( ! wroteHeader )
144
144
{
145
- CommandRuntime . WriteCommandDetail ( view . FormatHeader ( CLUEnvironment . Console . WindowWidth ) ) ;
146
- CommandRuntime . WriteCommandDetail ( "" ) ;
145
+ CommandRuntime . WriteObject ( view . FormatHeader ( CLUEnvironment . Console . WindowWidth ) ) ;
146
+ CommandRuntime . WriteObject ( "" ) ;
147
147
wroteHeader = true ;
148
148
}
149
- CommandRuntime . WriteCommandDetail ( view . FormatObject ( obj ) ) ;
149
+ CommandRuntime . WriteObject ( view . FormatObject ( obj ) ) ;
150
150
}
151
151
}
152
152
}
You can’t perform that action at this time.
0 commit comments