-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.ps1
executable file
·74 lines (59 loc) · 2.11 KB
/
Build.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
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# grommunio Admin API
# grommunio administration REST API
# Version: 1.9.2
#
function Get-FunctionsToExport {
[CmdletBinding()]
Param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[Alias('FullName')]
$Path
)
Process {
$Token = $null
$ParserErr = $null
$Ast = [System.Management.Automation.Language.Parser]::ParseFile(
$Path,
[ref]$Token,
[ref]$ParserErr
)
if ($ParserErr) {
throw $ParserErr
} else {
foreach ($name in 'Begin', 'Process', 'End') {
foreach ($Statement in $Ast."${name}Block".Statements) {
if (
[String]::IsNullOrWhiteSpace($Statement.Name) -or
$Statement.Extent.ToString() -notmatch
('function\W+{0}' -f $Statement.Name)
) {
continue
}
$Statement.Name
}
}
}
}
}
$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
$FunctionPath = 'Api', 'Model', 'Client' | ForEach-Object {Join-Path "$ScriptDir\src\GrommunioAdmin\" $_}
$Manifest = @{
Path = "$ScriptDir\src\GrommunioAdmin\GrommunioAdmin.psd1"
CompanyName = 'grommunio'
Description = 'GrommunioAdmin - the PowerShell module for grommunio Admin API'
Tags = @('grommunio' )
ProjectUri = 'https://grommunio.com'
LicenseUri = 'https://www.gnu.org/licenses/agpl-3.0.txt'
IconUri = 'https://grommunio.com/wp-content/uploads/2021/12/grommunio_logo_bg_square_media.svg'
ModuleVersion = '1.9.2'
RootModule = 'GrommunioAdmin.psm1'
Guid = '{A1D9801D-61B0-4395-939B-99C64CB426E5}' # Has to be static, otherwise each new build will be considered different module
PowerShellVersion = '6.2'
FunctionsToExport = $FunctionPath | Get-ChildItem -Filter *.ps1 | Get-FunctionsToExport
VariablesToExport = @()
AliasesToExport = @()
CmdletsToExport = @()
}
New-ModuleManifest @Manifest