-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpsakefile.ps1
32 lines (26 loc) · 1.3 KB
/
psakefile.ps1
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
Properties {
$ModuleName = Get-ChildItem -Path "$PSScriptRoot/*.psd1" | Select-Object -First 1 -ExpandProperty BaseName
$ManifestPath = Get-ChildItem -Path "$PSScriptRoot/*.psd1" | Select-Object -First 1 -ExpandProperty FullName
$PublicFunctions = Get-ChildItem -Path "$PSScriptRoot/Public/*.ps1" | Select-Object -ExpandProperty BaseName
}
Task Default -Depends UpdateExportedFunctions, UpdateReadMe
Task UpdateExportedFunctions {
Update-ModuleManifest -Path $ManifestPath -FunctionsToExport $PublicFunctions
}
Task UpdateReadMe {
Import-Module /Users/jhoek/GitHub/UncommonSense.PowerShell.Documentation/UncommonSense.PowerShell.Documentation.psd1 -Force
Import-Module (Join-Path $PSScriptRoot UncommonSense.PowerShell.Utils.psd1) -Force
Convert-HelpToMarkdown `
-Title $ModuleName `
-Commands (Get-Command -Module $ModuleName) `
-Description 'PowerShell utility cmdlets' |
Out-File -FilePath (Join-Path $PSScriptRoot README.md) -Encoding utf8
}
Task BumpVersionNo {
Update-ModuleManifest `
-Path $ManifestPath `
-ModuleVersion ((Get-ModuleVersion -Path $ManifestPath | Step-ModuleVersion -By Build).ToString(3))
}
Task Publish -Depends BumpVersionNo, UpdateExportedFunctions, UpdateReadMe {
Publish-Module -Path . -NuGetApiKey $env:NuGetApiKey
}