-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.ps1
More file actions
74 lines (59 loc) · 2.17 KB
/
Build.ps1
File metadata and controls
74 lines (59 loc) · 2.17 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# Real Green Service Assistant Common API
# No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
# Version: v01
# Generated by OpenAPI Generator: https://openapi-generator.tech
#
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' | Where-Object {
Join-Path "$ScriptDir\src\RealGreenSaPS\" $_ | Test-Path
} | ForEach-Object { Join-Path "$ScriptDir\src\RealGreenSaPS\" $_ }
$Manifest = @{
Path = "$ScriptDir\src\RealGreenSaPS\RealGreenSaPS.psd1"
Author = 'OpenAPI Generator Team'
CompanyName = 'openapitools.org'
Description = 'RealGreenSaPS - the PowerShell module for Real Green Service Assistant Common API'
ModuleVersion = '0.1.2'
RootModule = 'RealGreenSaPS.psm1'
Guid = '{BC10675A-5C5B-40B6-8432-18A19CEC6BAB}' # 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