forked from PoshCode/Metadata
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.ps1
More file actions
26 lines (22 loc) · 748 Bytes
/
Copy pathBuild.ps1
File metadata and controls
26 lines (22 loc) · 748 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
#requires -Module @{ModuleName = "ModuleBuilder"; ModuleVersion = "2.0.0"}, Configuration
[CmdletBinding()]
param(
# A specific folder to build into
$OutputDirectory,
# The version of the output module
[Alias("ModuleVersion")]
[string]$SemVer
)
# Sanitize parameters to pass to Build-Module
$ErrorActionPreference = "Stop"
Push-Location $PSScriptRoot -StackName BuildTestStack
if (-not $Semver -and (Get-Command gitversion -ErrorAction Ignore)) {
if ($semver = gitversion -showvariable NuGetVersion) {
$null = $PSBoundParameters.Add("SemVer", $SemVer)
}
}
try {
Build-Module @PSBoundParameters -Target CleanBuild -Passthru
} finally {
Pop-Location -StackName BuildTestStack
}