Skip to content

Commit

Permalink
Update module builder
Browse files Browse the repository at this point in the history
  • Loading branch information
PrzemyslawKlys committed Nov 3, 2023
1 parent 88860d4 commit e88e264
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Build/Build-ModuleSimplified.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,25 @@ Build-Module -ModuleName 'PSPublishModule' {
New-ConfigurationModule -Type RequiredModule -Name 'Pester' -Version Auto -Guid Auto

# Add external module dependencies, using loop for simplicity
foreach ($Module in @('PKI', 'Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.Archive', 'Microsoft.PowerShell.Management', 'Microsoft.PowerShell.Security')) {
New-ConfigurationModule -Type ExternalModule -Name $Module
}
New-ConfigurationModule -Type ExternalModule -Name @(
'Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.Archive', 'Microsoft.PowerShell.Management', 'Microsoft.PowerShell.Security'
)

# Add approved modules, that can be used as a dependency, but only when specific function from those modules is used
# And on that time only that function and dependant functions will be copied over
# Keep in mind it has it's limits when "copying" functions such as it should not depend on DLLs or other external files
New-ConfigurationModule -Type ApprovedModule -Name 'PSSharedGoods', 'PSWriteColor', 'Connectimo', 'PSUnifi', 'PSWebToolbox', 'PSMyPassword'

#New-ConfigurationModuleSkip -IgnoreFunctionName 'Invoke-Formatter', 'Find-Module' -IgnoreModuleName 'platyPS'
New-ConfigurationModuleSkip -IgnoreModuleName 'PKI', 'OpenAuthenticode' -IgnoreFunctionName @(
# ignore functions from OpenAuthenticode module when used during linux/macos build
'Set-OpenAuthenticodeSignature'
'Get-OpenAuthenticodeSignature'
# ignore functions from Microsoft.PowerShell.Security, as those are not on linux/macos
'Get-AuthenticodeSignature'
'Set-AuthenticodeSignature'
# ignore functions from PKI module when used during linux/macos build
#'Import-PfxCertificate'
)

$ConfigurationFormat = [ordered] @{
RemoveComments = $true
Expand Down

0 comments on commit e88e264

Please sign in to comment.