-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUpdate-ModuleReadMe.ps1
More file actions
34 lines (31 loc) · 923 Bytes
/
Update-ModuleReadMe.ps1
File metadata and controls
34 lines (31 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<#
.Synopsis
Append Cmdlet name and synopsis to a file.
.DESCRIPTION
Appends cmdlet name and exported synopsis to your readme file with a nice makrdown title prepended to the name.
You will need to remove the already present descriptions from the file if this has already beenrun before.
.EXAMPLE
Update-ModuleReadMe -Module util -ReadMe .\README.md
#>
function Update-ModuleReadMe
{
[CmdletBinding()]
[Alias()]
[OutputType([int])]
Param
(
# Param1 help description
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=0)]
$Module,
$ReadMe
)
Get-Command -Module $Module |
Get-Help |
select name,Synopsis |
foreach {
'#### ' + $_.name + [System.Environment]::NewLine + $_.Synopsis
} |
Out-File -FilePath $ReadMe -Encoding utf8 -Append
}