@@ -202,28 +202,40 @@ private void WriteParameterHelp(dynamic helpContent)
202
202
{
203
203
helpBlock = new Collection < string > ( )
204
204
{
205
- String . Empty ,
205
+ string . Empty ,
206
206
PSReadLineResources . NeedsUpdateHelp
207
207
} ;
208
208
}
209
209
else
210
210
{
211
211
string syntax = $ "-{ helpContent . name } <{ helpContent . type . name } >";
212
- string desc = "DESC: " + helpContent . Description [ 0 ] . Text ;
213
-
214
- // trim new line characters as some help content has it at the end of the first list on the description.
215
- desc = desc . Trim ( '\r ' , '\n ' ) ;
216
-
217
- string details = $ "Required: { helpContent . required } , Position: { helpContent . position } , Default Value: { helpContent . defaultValue } , Pipeline Input: { helpContent . pipelineInput } , WildCard: { helpContent . globbing } ";
218
-
219
212
helpBlock = new Collection < string >
220
213
{
221
214
string . Empty ,
222
215
syntax ,
223
- string . Empty ,
224
- desc ,
225
- details
216
+ string . Empty
226
217
} ;
218
+
219
+ string text = helpContent . Description [ 0 ] . Text ;
220
+ if ( text . Contains ( "\n " ) )
221
+ {
222
+ string [ ] lines = text . Split ( new char [ ] { '\n ' } , StringSplitOptions . RemoveEmptyEntries ) ;
223
+ for ( int i = 0 ; i < lines . Length ; i ++ )
224
+ {
225
+ string prefix = i == 0 ? "DESC: " : " " ;
226
+ string s = prefix + lines [ i ] . Trim ( '\r ' ) ;
227
+ helpBlock . Add ( s ) ;
228
+ }
229
+ }
230
+ else
231
+ {
232
+ string desc = "DESC: " + text ;
233
+ // trim new line characters as some help content has it at the end of the first list on the description.
234
+ helpBlock . Add ( desc . Trim ( '\r ' , '\n ' ) ) ;
235
+ }
236
+
237
+ string details = $ "Required: { helpContent . required } , Position: { helpContent . position } , Default Value: { helpContent . defaultValue } , Pipeline Input: { helpContent . pipelineInput } , WildCard: { helpContent . globbing } ";
238
+ helpBlock . Add ( details ) ;
227
239
}
228
240
229
241
WriteDynamicHelpBlock ( helpBlock ) ;
0 commit comments