From 0a5b78c983b022a90b71d8c15a4cb3dfb34021db Mon Sep 17 00:00:00 2001 From: StartAutomating Date: Sun, 17 Apr 2022 14:22:17 -0700 Subject: [PATCH] Fixing RichModuleInfo (#41) --- Formatting/RichModuleInfo.view.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Formatting/RichModuleInfo.view.ps1 b/Formatting/RichModuleInfo.view.ps1 index 091bc82..1b5020a 100644 --- a/Formatting/RichModuleInfo.view.ps1 +++ b/Formatting/RichModuleInfo.view.ps1 @@ -1,6 +1,4 @@ -[OutputType([Management.Automation.PSModuleInfo])] -[PSTypeName('EZOut.RichModuleInfo')] -param($_ = (Get-Module EZOut)) +Write-FormatView -TypeName "System.Management.Automation.PSModuleInfo", "EZOut.RichModuleInfo" -Action { $module = $_ @( $moduleNameVer = $module.Name + $( @@ -8,9 +6,9 @@ $module = $_ " [$($module.Version)]" } ) - . $Heading $moduleNameVer -Level 1 + Format-Markdown -Heading $moduleNameVer -HeadingSize 2 if ($module.Description) { - . $heading $module.Description -UnderlineLength $moduleNameVer.Length + Format-Markdown -Heading $module.Description -HeadingSize 3 } $commandSection = if ($module.ExportedCommands.Count) { @@ -26,6 +24,7 @@ $module = $_ Select-Object -ExpandProperty Maximum $maxNounLength = $module.ExportedCommands.Values | + Where-Object { $_.Noun } | Select-Object -ExpandProperty Noun | Measure-Object -Property Length -Maximum | Select-Object -ExpandProperty Maximum @@ -70,4 +69,5 @@ $module = $_ Write-Verbose "No help.txt file found at $aboutTextFile" } } -) -join [Environment]::NewLine \ No newline at end of file +) -join [Environment]::NewLine +} \ No newline at end of file