forked from ModuleBuild/ModuleBuild
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.ps1
More file actions
58 lines (48 loc) · 1.52 KB
/
Copy pathmake.ps1
File metadata and controls
58 lines (48 loc) · 1.52 KB
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
<#
Make the plaster template manifest file for this project.
#>
$ModuleBuildPath = '.\ModuleBuild\plasterManifest.xml'
Write-Output 'Creating the plaster manifest file for this project...'
# First ensure that our custom version of Plaster is loaded
Remove-Module Plaster -ErrorAction:SilentlyContinue
try {
Import-Module '.\PlasterModule\Plaster.psd1'
}
catch {
throw 'You need the plaster module to build this plaster manifest.'
}
# Load our parameter and content
. .\PlasterParams.ps1
. .\PlasterContent.ps1
$version = (git describe --match "v[0-9]*") -replace 'v',''
if ($null -eq $version) {
$version = '0.0.1'
}
elseif ($version -match '^([0-9]\.[0-9]\.[0-9]).*$') {
$version = $Matches[1]
}
else {
$version = '0.0.1'
}
$params = @{
Path = $ModuleBuildPath
TemplateName = 'ModuleBuild'
TemplateVersion = $version
Author = 'Zachary Loeber'
Description = 'Create a new PowerShell Module with a ModuleBuild wrapper'
Tags = 'Module, ModuleManifest, ModuleBuild'
Title = 'New ModuleBuild Project'
TemplateType = 'Project'
Content = $Content | Write-PlasterManifestContent
Parameters = $Parameters | Write-PlasterParameter
}
# Create the initial manifest
New-PlasterManifest @params
try {
$null = Test-PlasterManifest .\ModuleBuild\plasterManifest.xml -Verbose
Write-Output 'The new plaster manifest for ModuleBuild has been created in .\ModuleBuild\plasterManifest.xml'
}
catch {
Test-PlasterManifest .\ModuleBuild\plasterManifest.xml -verbose
}
Remove-module Plaster