Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
60 lines (52 loc) · 2.36 KB

File metadata and controls

60 lines (52 loc) · 2.36 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function Build-PSModule {
<#
.SYNOPSIS
Builds a module.
.DESCRIPTION
Builds a module.
#>
[OutputType([void])]
[CmdletBinding()]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSReviewUnusedParameter', '', Scope = 'Function',
Justification = 'LogGroup - Scoping affects the variables line of sight.'
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingWriteHost', '', Scope = 'Function',
Justification = 'Want to just write to the console, not the pipeline.'
)]
param(
# Name of the module.
[Parameter(Mandatory)]
[string] $ModuleName,
# Path to the folder where the modules are located.
[Parameter(Mandatory)]
[string] $ModuleSourceFolderPath,
# Path to the folder where the built modules are outputted.
[Parameter(Mandatory)]
[string] $ModuleOutputFolderPath,
# Module version to stamp into the manifest.
[Parameter(Mandatory)]
[string] $ModuleVersion,
# Prerelease tag to stamp into the manifest. When empty, no prerelease tag is written.
[Parameter()]
[string] $ModulePrerelease
)
Set-GitHubLogGroup "Building module [$ModuleName]" {
$moduleSourceFolder = Get-Item -Path $ModuleSourceFolderPath
$moduleOutputFolder = New-Item -Path $ModuleOutputFolderPath -Name $ModuleName -ItemType Directory -Force
[pscustomobject]@{
ModuleSourceFolderPath = $moduleSourceFolder
ModuleOutputFolderPath = $moduleOutputFolder
} | Format-List | Out-String
}
Build-PSModuleBase -ModuleName $ModuleName -ModuleSourceFolder $moduleSourceFolder -ModuleOutputFolder $moduleOutputFolder
Build-PSModuleManifest -ModuleName $ModuleName -ModuleOutputFolder $moduleOutputFolder `
-ModuleVersion $ModuleVersion -ModulePrerelease $ModulePrerelease
Build-PSModuleRootModule -ModuleName $ModuleName -ModuleOutputFolder $moduleOutputFolder
Update-PSModuleManifestAliasesToExport -ModuleName $ModuleName -ModuleSourceFolder $moduleSourceFolder -ModuleOutputFolder $moduleOutputFolder
Set-GitHubLogGroup 'Build manifest file - Final Result' {
$outputManifestPath = Join-Path -Path $ModuleOutputFolder -ChildPath "$ModuleName.psd1"
Show-FileContent -Path $outputManifestPath
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.