@@ -185,33 +185,55 @@ internal static CommandHelp ConvertDictionaryToCommandHelp(OrderedDictionary? di
185185 if ( dictionary [ "metadata" ] is IDictionary < object , object > metadata )
186186 {
187187 help . Metadata = GetMetadataFromDictionary ( metadata ) ;
188+ help . Diagnostics . TryAddDiagnostic ( DiagnosticMessageSource . General , "Found Metadata" , DiagnosticSeverity . Information , "yaml metadata" , - 1 ) ;
188189 }
189190
190191 if ( dictionary [ "synopsis" ] is string synopsis )
191192 {
193+ help . Diagnostics . TryAddDiagnostic ( DiagnosticMessageSource . Synopsis , $ "Synopsis length: { synopsis . Length } ", DiagnosticSeverity . Information , "yaml synopsis" , - 1 ) ;
192194 help . Synopsis = synopsis ;
193195 }
196+ else
197+ {
198+ help . Diagnostics . TryAddDiagnostic ( DiagnosticMessageSource . Synopsis , "No synopsis" , DiagnosticSeverity . Warning , "yaml synopsis" , - 1 ) ;
199+ }
194200
195201 if ( dictionary [ "title" ] is string title )
196202 {
203+ help . Diagnostics . TryAddDiagnostic ( DiagnosticMessageSource . General , $ "Title length: { title . Length } ", DiagnosticSeverity . Information , "yaml title" , - 1 ) ;
197204 help . Title = title ;
198205 }
206+ else
207+ {
208+ help . Diagnostics . TryAddDiagnostic ( DiagnosticMessageSource . General , "No title" , DiagnosticSeverity . Warning , "yaml title" , - 1 ) ;
209+ }
199210
200211 if ( dictionary [ "description" ] is string description )
201212 {
213+ help . Diagnostics . TryAddDiagnostic ( DiagnosticMessageSource . Description , $ "Description length: { description . Length } ", DiagnosticSeverity . Information , "yaml description" , - 1 ) ;
202214 help . Description = description ;
203215 }
216+ else
217+ {
218+ help . Diagnostics . TryAddDiagnostic ( DiagnosticMessageSource . Description , "No description" , DiagnosticSeverity . Warning , "yaml description" , - 1 ) ;
219+ }
204220
205221 if ( dictionary [ "notes" ] is string notes )
206222 {
223+ help . Diagnostics . TryAddDiagnostic ( DiagnosticMessageSource . Notes , $ "notes length: { notes . Length } ", DiagnosticSeverity . Information , "yaml notes" , - 1 ) ;
207224 help . Notes = notes ;
208225 }
209226 else
210227 {
228+ help . Diagnostics . TryAddDiagnostic ( DiagnosticMessageSource . Notes , "No description" , DiagnosticSeverity . Information , "yaml notes" , - 1 ) ;
211229 help . Notes = string . Empty ;
212230 }
213231
214232 help . Syntax . AddRange ( GetSyntaxFromDictionary ( dictionary ) ) ;
233+ if ( help . Aliases is not null )
234+ {
235+ help . Aliases . AddRange ( GetAliasesFromDictionary ( dictionary ) ) ;
236+ }
215237 help . Examples ? . AddRange ( GetExamplesFromDictionary ( dictionary ) ) ;
216238 help . Parameters . AddRange ( GetParametersFromDictionary ( dictionary ) ) ;
217239 help . Inputs . AddRange ( GetInputsFromDictionary ( dictionary ) ) ;
@@ -225,9 +247,6 @@ internal static CommandHelp ConvertDictionaryToCommandHelp(OrderedDictionary? di
225247 if ( help . Metadata is not null )
226248 {
227249 help . ModuleGuid = help . Metadata . Contains ( "ModuleGuid" ) ? new Guid ( help . Metadata [ "ModuleGuid" ] . ToString ( ) ) : null ;
228- // help.ExternalHelpFile = help.Metadata.Contains("external help file") ? help.Metadata["external help file"].ToString() : string.Empty;
229- // help.OnlineVersionUrl = help.Metadata.Contains("HelpUri") ? help.Metadata["HelpUri"].ToString() : string.Empty;
230- // help.SchemaVersion = help.Metadata.Contains("PlatyPS schema version") ? help.Metadata["PlatyPS schema version"].ToString() : string.Empty;
231250 help . ModuleName = help . Metadata . Contains ( "Module Name" ) ? help . Metadata [ "Module Name" ] . ToString ( ) : string . Empty ;
232251 }
233252
@@ -559,6 +578,19 @@ private static List<Links> GetRelatedLinksFromDictionary(OrderedDictionary dicti
559578 return links ;
560579 }
561580
581+ private static List < string > GetAliasesFromDictionary ( OrderedDictionary dictionary )
582+ {
583+ List < string > aliases = new ( ) ;
584+ if ( dictionary [ "aliases" ] is List < object > aliasList )
585+ {
586+ foreach ( var alias in aliasList )
587+ {
588+ aliases . Add ( alias . ToString ( ) ) ;
589+ }
590+ }
591+ return aliases ;
592+ }
593+
562594 private static List < Example > GetExamplesFromDictionary ( OrderedDictionary dictionary )
563595 {
564596 List < Example > examples = new ( ) ;
0 commit comments