Skip to content

Commit

Permalink
Fixing RichModuleInfo (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
StartAutomating committed Apr 17, 2022
1 parent c6df87b commit 0a5b78c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Formatting/RichModuleInfo.view.ps1
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
[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 + $(
if ($module.Version) {
" [$($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) {
Expand All @@ -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
Expand Down Expand Up @@ -70,4 +69,5 @@ $module = $_
Write-Verbose "No help.txt file found at $aboutTextFile"
}
}
) -join [Environment]::NewLine
) -join [Environment]::NewLine
}

0 comments on commit 0a5b78c

Please sign in to comment.