forked from EvotecIT/IntelligenceX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild-Module.ps1
More file actions
96 lines (81 loc) · 5.43 KB
/
Copy pathBuild-Module.ps1
File metadata and controls
96 lines (81 loc) · 5.43 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Import-Module "PSPublishModule" -Force
Build-Module -ModuleName 'IntelligenceX' {
# Usual defaults as per standard module
$Manifest = [ordered] @{
ModuleVersion = '0.1.0'
CompatiblePSEditions = @('Desktop', 'Core')
GUID = '8fc3e038-c57b-44f3-bc7f-714beb3bd65a'
Author = 'Przemyslaw Klys'
CompanyName = 'Evotec'
Copyright = "(c) 2011 - $((Get-Date).Year) Przemyslaw Klys @ Evotec. All rights reserved."
Description = 'IntelligenceX is a PowerShell module for the Codex app-server client.'
Tags = @('Windows', 'MacOS', 'Linux')
IconUri = 'https://raw.githubusercontent.com/EvotecIT/IntelligenceX/master/Assets/Icons/IntelligenceX_128x128.png'
ProjectUri = 'https://github.com/EvotecIT/IntelligenceX'
PowerShellVersion = '5.1'
# FormatsToProcess = @('IntelligenceX.Format.ps1xml')
}
New-ConfigurationManifest @Manifest
$ConfigurationFormat = [ordered] @{
RemoveComments = $false
PlaceOpenBraceEnable = $true
PlaceOpenBraceOnSameLine = $true
PlaceOpenBraceNewLineAfter = $true
PlaceOpenBraceIgnoreOneLineBlock = $false
PlaceCloseBraceEnable = $true
PlaceCloseBraceNewLineAfter = $false
PlaceCloseBraceIgnoreOneLineBlock = $false
PlaceCloseBraceNoEmptyLineBefore = $true
UseConsistentIndentationEnable = $true
UseConsistentIndentationKind = 'space'
UseConsistentIndentationPipelineIndentation = 'IncreaseIndentationAfterEveryPipeline'
UseConsistentIndentationIndentationSize = 4
UseConsistentWhitespaceEnable = $true
UseConsistentWhitespaceCheckInnerBrace = $true
UseConsistentWhitespaceCheckOpenBrace = $true
UseConsistentWhitespaceCheckOpenParen = $true
UseConsistentWhitespaceCheckOperator = $true
UseConsistentWhitespaceCheckPipe = $true
UseConsistentWhitespaceCheckSeparator = $true
AlignAssignmentStatementEnable = $true
AlignAssignmentStatementCheckHashtable = $true
UseCorrectCasingEnable = $true
}
# format PSD1 and PSM1 files when merging into a single file
# enable formatting is not required as Configuration is provided
New-ConfigurationFormat -ApplyTo 'OnMergePSM1', 'OnMergePSD1' -Sort None @ConfigurationFormat
# format PSD1 and PSM1 files within the module
# enable formatting is required to make sure that formatting is applied (with default settings)
New-ConfigurationFormat -ApplyTo 'DefaultPSD1', 'DefaultPSM1' -EnableFormatting -Sort None
# when creating PSD1 use special style without comments and with only required parameters
New-ConfigurationFormat -ApplyTo 'DefaultPSD1', 'OnMergePSD1' -PSD1Style 'Minimal'
# configuration for documentation, at the same time it enables documentation processing
New-ConfigurationDocumentation -Enable:$false -StartClean -UpdateWhenNew -PathReadme 'Docs\Readme.md' -Path 'Docs'
New-ConfigurationImportModule -ImportSelf -ImportRequiredModules
$newConfigurationBuildSplat = @{
Enable = $true
SignModule = $true
MergeModuleOnBuild = $true
MergeFunctionsFromApprovedModules = $true
CertificateThumbprint = '483292C9E317AA13B07BB7A96AE9D1A5ED9E7703'
NETProjectPath = "$PSScriptRoot\..\..\IntelligenceX.PowerShell"
ResolveBinaryConflicts = $true
ResolveBinaryConflictsName = 'IntelligenceX.PowerShell'
NETProjectName = 'IntelligenceX.PowerShell'
NETBinaryModule = 'IntelligenceX.PowerShell.dll'
NETConfiguration = 'Release'
NETFramework = 'net472', 'net8.0'
DotSourceLibraries = $true
NETSearchClass = 'IntelligenceX.PowerShell.CmdletConnectIntelligenceX'
NETBinaryModuleDocumentation = $true
RefreshPSD1Only = $true
}
New-ConfigurationBuild @newConfigurationBuildSplat
# Copy formatting file to module output
#New-ConfigurationModule -Type RequiredFile -Path "$PSScriptRoot\..\..\IntelligenceX.PowerShell\IntelligenceX.Format.ps1xml" -Destination 'IntelligenceX.Format.ps1xml'
New-ConfigurationArtefact -Type Unpacked -Enable -Path "$PSScriptRoot\..\Artefacts\Unpacked" -RequiredModulesPath "$PSScriptRoot\..\Artefacts\Unpacked\Modules"
New-ConfigurationArtefact -Type Packed -Enable -Path "$PSScriptRoot\..\Artefacts\Packed" -IncludeTagName -ArtefactName "IntelligenceX-PowerShellModule.<TagModuleVersionWithPreRelease>.zip" -ID 'ToGitHub'
# global options for publishing to github/psgallery
#New-ConfigurationPublish -Type PowerShellGallery -FilePath 'C:\Support\Important\PowerShellGalleryAPI.txt' -Enabled:$true
#New-ConfigurationPublish -Type GitHub -FilePath 'C:\Support\Important\GitHubAPI.txt' -UserName 'EvotecIT' -Enabled:$true -ID 'ToGitHub' -OverwriteTagName 'IntelligenceX-PowerShellModule.<TagModuleVersionWithPreRelease>'
}