-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.ps1
More file actions
26 lines (20 loc) · 806 Bytes
/
build.ps1
File metadata and controls
26 lines (20 loc) · 806 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
param(
$renameFiles = $true
)
#$cert = @(Get-ChildItem cert:\CurrentUser\My -codesigning)[0]
function SignScript ($file) {
Set-AuthenticodeSignature $file $cert > $null
}
Del -Path '.\output' -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType 'directory' -Path '.\output'
Copy-Item 'app\*' '.\output' -Container -Recurse
$moduleVersion = "1.$(Get-Date -UFormat '%d%m%Y')"
$modules = Get-ChildItem -Path '.\output\*.psm1' -Recurse
$modules.ForEach({
$moduleName = (Split-Path -Leaf $_).split('\.')[-2]
$modulePath = Split-Path -Parent $_
$moduleFile = "$($modulePath)\$($moduleName).psd1"
New-ModuleManifest $moduleFile -ModuleVersion $moduleVersion -Author 'Gio' -CompanyName 'Illyum' -RootModule "$($moduleName).psm1"
#SignScript $moduleFile
#SignScript $_
})