Prefer local PowerForge module for website artifacts (#86)

* Prefer local PowerForge module for website artifacts

* Ignore generated website artifact outputs
This commit is contained in:
Przemysław Kłys
2026-03-07 18:29:44 +01:00
committed by GitHub
parent fe8ba6414c
commit e10e01a17b
3 changed files with 457 additions and 230 deletions
+10 -8
View File
@@ -1,8 +1,10 @@
Ignore/* Ignore/*
.vs/* .vs/*
.vscode/* .vscode/*
Releases/* Releases/*
ReleasesUnpacked/* ReleasesUnpacked/*
*.log *.log
*.html *.html
Artefacts/* Artefacts/*
WebsiteArtifacts/
en-US/
+188
View File
@@ -0,0 +1,188 @@
[CmdletBinding()]
param(
[switch]$SkipBuild,
[string]$ArtifactsRoot = (Join-Path $PSScriptRoot '..\WebsiteArtifacts')
)
$ErrorActionPreference = 'Stop'
$repoRoot = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
$moduleName = 'GPOZaurr'
$slug = 'gpozaurr'
$docsSource = Join-Path $repoRoot 'Docs'
$helpCandidates = @(
(Join-Path $repoRoot "en-US\$moduleName-help.xml"),
(Join-Path $repoRoot "Artefacts\Unpacked\$moduleName\en-US\$moduleName-help.xml")
)
$examplesSource = Join-Path $repoRoot 'Examples'
$placeholderMarkers = @(
'{{ Fill in the Synopsis }}',
'{{ Fill in the Description }}',
'{{ Add example code here }}',
'{{ Add example description here }}'
)
function Import-LocalPSPublishModule {
$candidateRoots = @()
if ($env:POWERFORGE_ROOT) {
$candidateRoots += $env:POWERFORGE_ROOT
}
$candidateRoots += [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..\..\PSPublishModule'))
foreach ($root in $candidateRoots | Select-Object -Unique) {
if ([string]::IsNullOrWhiteSpace($root)) {
continue
}
$manifestPath = Join-Path $root 'Module\PSPublishModule.psd1'
if (Test-Path -LiteralPath $manifestPath -PathType Leaf) {
Import-Module $manifestPath -Force -ErrorAction Stop
return
}
}
Import-Module PSPublishModule -Force -ErrorAction Stop
}
function Find-HelpFile {
foreach ($candidate in $helpCandidates) {
if (Test-Path -LiteralPath $candidate -PathType Leaf) {
return [System.IO.Path]::GetFullPath($candidate)
}
}
return $null
}
function Test-PlaceholderContent {
param(
[Parameter(Mandatory)]
[string]$Path
)
foreach ($marker in $placeholderMarkers) {
$match = Select-String -Path $Path -Pattern $marker -SimpleMatch -List -ErrorAction SilentlyContinue
if ($match) {
throw "Placeholder API content detected in '$Path' ($marker)."
}
}
}
function Get-PlaceholderMatches {
param(
[Parameter(Mandatory)]
[string]$Path
)
if (-not (Test-Path -LiteralPath $Path)) {
return @()
}
$files = if (Test-Path -LiteralPath $Path -PathType Container) {
Get-ChildItem -LiteralPath $Path -File -Recurse
} else {
Get-Item -LiteralPath $Path
}
foreach ($file in $files) {
foreach ($marker in $placeholderMarkers) {
$match = Select-String -Path $file.FullName -Pattern $marker -SimpleMatch -List -ErrorAction SilentlyContinue
if ($match) {
[PSCustomObject]@{
Path = $file.FullName
Marker = $marker
}
break
}
}
}
}
if (-not (Get-Command Invoke-ModuleBuild -ErrorAction SilentlyContinue)) {
Import-LocalPSPublishModule
}
$helpPath = Find-HelpFile
if (-not $helpPath -and -not $SkipBuild) {
$docsPlaceholders = @(Get-PlaceholderMatches -Path $docsSource)
if ($docsPlaceholders.Count -gt 0) {
$sample = ($docsPlaceholders | Select-Object -First 5 | ForEach-Object { "$($_.Path) [$($_.Marker)]" }) -join '; '
Write-Warning "Docs still contain placeholder markdown from a previous generation pass. Continuing with module build so fresh external help can be regenerated. Sample matches: $sample"
}
try {
& (Join-Path $PSScriptRoot 'Manage-Module.ps1') -SkipPublish
} catch {
$helpPath = Find-HelpFile
if (-not $helpPath) {
throw
}
Write-Warning "Manage-Module.ps1 reported a build failure after external help was generated. Continuing website artifact export with the refreshed help output. Original error: $($_.Exception.Message)"
}
$helpPath = Find-HelpFile
}
if (-not $helpPath) {
throw "Unable to find $moduleName external help. Run .\Build\Manage-Module.ps1 first."
}
Test-PlaceholderContent -Path $helpPath
$resolvedArtifactsRoot = [System.IO.Path]::GetFullPath($ArtifactsRoot)
$apiRoot = Join-Path $resolvedArtifactsRoot 'apidocs\powershell'
$examplesTarget = Join-Path $apiRoot 'examples'
if (Test-Path -LiteralPath $apiRoot) {
Remove-Item -LiteralPath $apiRoot -Recurse -Force
}
New-Item -ItemType Directory -Path $apiRoot -Force | Out-Null
Copy-Item -LiteralPath $helpPath -Destination (Join-Path $apiRoot "$moduleName-help.xml") -Force
if (Test-Path -LiteralPath $examplesSource -PathType Container) {
Copy-Item -LiteralPath $examplesSource -Destination $examplesTarget -Recurse -Force
}
$psd1Path = Join-Path $repoRoot "$moduleName.psd1"
$version = $null
if (Test-Path -LiteralPath $psd1Path -PathType Leaf) {
$version = (Import-PowerShellDataFile -Path $psd1Path).ModuleVersion.ToString()
}
$commit = (& git -C $repoRoot rev-parse HEAD).Trim()
$manifest = [ordered]@{
slug = $slug
name = $moduleName
description = 'GPOZaurr website artifacts for the Evotec multi-project hub.'
mode = 'hub-full'
contentMode = 'hybrid'
status = 'active'
listed = $true
version = $version
generatedAt = (Get-Date).ToString('o')
commit = $commit
links = [ordered]@{
source = 'https://github.com/EvotecIT/GPOZaurr'
}
surfaces = [ordered]@{
docs = $true
apiPowerShell = $true
apiDotNet = $false
examples = $false
}
artifacts = [ordered]@{
api = 'WebsiteArtifacts/apidocs'
docs = 'Website/content/project-docs'
examples = 'Examples'
}
}
$manifestPath = Join-Path $resolvedArtifactsRoot 'project-manifest.json'
New-Item -ItemType Directory -Path $resolvedArtifactsRoot -Force | Out-Null
$manifest | ConvertTo-Json -Depth 6 | Set-Content -LiteralPath $manifestPath -Encoding UTF8
Write-Host "Exported website artifacts -> $resolvedArtifactsRoot" -ForegroundColor Green
+259 -222
View File
@@ -1,225 +1,262 @@
Clear-Host [CmdletBinding()]
param(
[switch]$SkipPublish
)
try {
Clear-Host
} catch {
Write-Verbose "Skipping Clear-Host because the current host is non-interactive."
}
function Import-LocalPSPublishModule {
$candidateRoots = @()
if ($env:POWERFORGE_ROOT) {
$candidateRoots += $env:POWERFORGE_ROOT
}
$candidateRoots += [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..\..\PSPublishModule'))
foreach ($root in $candidateRoots | Select-Object -Unique) {
if ([string]::IsNullOrWhiteSpace($root)) {
continue
}
$manifestPath = Join-Path $root 'Module\PSPublishModule.psd1'
if (Test-Path -LiteralPath $manifestPath -PathType Leaf) {
Import-Module $manifestPath -Force -ErrorAction Stop
return
}
}
Import-Module PSPublishModule -Force -ErrorAction Stop
}
Import-LocalPSPublishModule
Invoke-ModuleBuild -ModuleName 'GPOZaurr' { Invoke-ModuleBuild -ModuleName 'GPOZaurr' {
# Usual defaults as per standard module # Usual defaults as per standard module
$Manifest = @{ $Manifest = @{
# Version number of this module. # Version number of this module.
ModuleVersion = '1.1.X' ModuleVersion = '1.1.X'
# Supported PSEditions # Supported PSEditions
CompatiblePSEditions = @('Desktop') CompatiblePSEditions = @('Desktop')
# ID used to uniquely identify this module # ID used to uniquely identify this module
GUID = 'f7d4c9e4-0298-4f51-ad77-e8e3febebbde' GUID = 'f7d4c9e4-0298-4f51-ad77-e8e3febebbde'
# Author of this module # Author of this module
Author = 'Przemyslaw Klys' Author = 'Przemyslaw Klys'
# Company or vendor of this module # Company or vendor of this module
CompanyName = 'Evotec' CompanyName = 'Evotec'
# Copyright statement for this module # Copyright statement for this module
Copyright = "(c) 2011 - $((Get-Date).Year) Przemyslaw Klys @ Evotec. All rights reserved." Copyright = "(c) 2011 - $((Get-Date).Year) Przemyslaw Klys @ Evotec. All rights reserved."
# Description of the functionality provided by this module # Description of the functionality provided by this module
Description = 'Group Policy Eater is a PowerShell module that aims to gather information about Group Policies but also allows fixing issues that you may find in them.' Description = 'Group Policy Eater is a PowerShell module that aims to gather information about Group Policies but also allows fixing issues that you may find in them.'
# Minimum version of the Windows PowerShell engine required by this module # Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '5.1' PowerShellVersion = '5.1'
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
Tags = @('Windows', 'ActiveDirectory', 'GPO', 'GroupPolicy') Tags = @('Windows', 'ActiveDirectory', 'GPO', 'GroupPolicy')
#IconUri = 'https://evotec.xyz/wp-content/uploads/2019/02/PSPublishModule.png' #IconUri = 'https://evotec.xyz/wp-content/uploads/2019/02/PSPublishModule.png'
ProjectUri = 'https://github.com/EvotecIT/GPOZaurr' ProjectUri = 'https://github.com/EvotecIT/GPOZaurr'
} }
New-ConfigurationManifest @Manifest New-ConfigurationManifest @Manifest
New-ConfigurationModule -Type RequiredModule -Name 'PSWriteColor', 'PSSharedGoods', 'ADEssentials' -Guid Auto -Version Latest New-ConfigurationModule -Type RequiredModule -Name 'PSWriteColor', 'PSSharedGoods', 'ADEssentials' -Guid Auto -Version Latest
New-ConfigurationModule -Type RequiredModule -Name "PSWriteHTML" -Guid Auto -Version "1.27.0" New-ConfigurationModule -Type RequiredModule -Name "PSWriteHTML" -Guid Auto -Version "1.27.0"
#New-ConfigurationModule -Type ExternalModule -Name 'Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.Management','Microsoft.PowerShell.Security' #New-ConfigurationModule -Type ExternalModule -Name 'Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.Management','Microsoft.PowerShell.Security'
New-ConfigurationModule -Type ApprovedModule -Name 'PSSharedGoods', 'PSWriteColor', 'Connectimo', 'PSUnifi', 'PSWebToolbox', 'PSMyPassword', 'ADEssentials' New-ConfigurationModule -Type ApprovedModule -Name 'PSSharedGoods', 'PSWriteColor', 'Connectimo', 'PSUnifi', 'PSWebToolbox', 'PSMyPassword', 'ADEssentials'
New-ConfigurationModule -Type ExternalModule -Name @( New-ConfigurationModule -Type ExternalModule -Name @(
"CimCmdlets" "CimCmdlets"
'Microsoft.PowerShell.Management' 'Microsoft.PowerShell.Management'
'Microsoft.PowerShell.Utility' 'Microsoft.PowerShell.Utility'
'Microsoft.PowerShell.Security' 'Microsoft.PowerShell.Security'
) )
New-ConfigurationModuleSkip -IgnoreModuleName @( New-ConfigurationModuleSkip -IgnoreModuleName @(
# this are builtin into PowerShell, so not critical # this are builtin into PowerShell, so not critical
'powershellget' 'powershellget'
'GroupPolicy' 'GroupPolicy'
'ScheduledTasks' 'ScheduledTasks'
'ActiveDirectory' 'ActiveDirectory'
'Microsoft.WSMan.Management' 'Microsoft.WSMan.Management'
'NetConnection' 'NetConnection'
'NetSecurity' 'NetSecurity'
'NetTCPIP' 'NetTCPIP'
) -IgnoreFunctionName @( ) -IgnoreFunctionName @(
'Select-Unique' 'Select-Unique'
) )
New-ConfigurationCommand -ModuleName 'ActiveDirectory' -CommandName @( New-ConfigurationCommand -ModuleName 'ActiveDirectory' -CommandName @(
'Add-GPOPermission' 'Add-GPOPermission'
'Add-GPOZaurrPermission' 'Add-GPOZaurrPermission'
'Backup-GPOZaurr' 'Backup-GPOZaurr'
'Clear-GPOZaurrSysvolDFSR' 'Clear-GPOZaurrSysvolDFSR'
'ConvertFrom-CSExtension' 'ConvertFrom-CSExtension'
'Find-CSExtension' 'Find-CSExtension'
'Get-GPOZaurr' 'Get-GPOZaurr'
'Get-GPOZaurrAD' 'Get-GPOZaurrAD'
'Get-GPOZaurrBackupInformation' 'Get-GPOZaurrBackupInformation'
'Get-GPOZaurrBroken' 'Get-GPOZaurrBroken'
'Get-GPOZaurrDictionary' 'Get-GPOZaurrDictionary'
'Get-GPOZaurrDuplicateObject' 'Get-GPOZaurrDuplicateObject'
'Get-GPOZaurrFiles' 'Get-GPOZaurrFiles'
'Get-GPOZaurrFilesPolicyDefinition' 'Get-GPOZaurrFilesPolicyDefinition'
'Get-GPOZaurrFolders' 'Get-GPOZaurrFolders'
'Get-GPOZaurrInheritance' 'Get-GPOZaurrInheritance'
'Get-GPOZaurrLegacyFiles' 'Get-GPOZaurrLegacyFiles'
'Get-GPOZaurrLink' 'Get-GPOZaurrLink'
'Get-GPOZaurrLinkSummary' 'Get-GPOZaurrLinkSummary'
'Get-GPOZaurrNetLogon' 'Get-GPOZaurrNetLogon'
'Get-GPOZaurrOwner' 'Get-GPOZaurrOwner'
'Get-GPOZaurrPassword' 'Get-GPOZaurrPassword'
'Get-GPOZaurrPermission' 'Get-GPOZaurrPermission'
'Get-GPOZaurrPermissionConsistency' 'Get-GPOZaurrPermissionConsistency'
'Get-GPOZaurrPermissionRoot' 'Get-GPOZaurrPermissionRoot'
'Get-GPOZaurrPermissionSummary' 'Get-GPOZaurrPermissionSummary'
'Get-GPOZaurrSysvolDFSR' 'Get-GPOZaurrSysvolDFSR'
'Get-GPOZaurrWMI' 'Get-GPOZaurrWMI'
'Invoke-GPOZaurr' 'Invoke-GPOZaurr'
#'Invoke-GPOZaurrContent' #'Invoke-GPOZaurrContent'
'Invoke-GPOZaurrPermission' 'Invoke-GPOZaurrPermission'
'Invoke-GPOZaurrSupport' 'Invoke-GPOZaurrSupport'
'New-GPOZaurrWMI' 'New-GPOZaurrWMI'
'Optimize-GPOZaurr' 'Optimize-GPOZaurr'
'Remove-GPOPermission' 'Remove-GPOPermission'
'Remove-GPOZaurr' 'Remove-GPOZaurr'
'Remove-GPOZaurrBroken' 'Remove-GPOZaurrBroken'
'Remove-GPOZaurrDuplicateObject' 'Remove-GPOZaurrDuplicateObject'
'Remove-GPOZaurrFolders' 'Remove-GPOZaurrFolders'
'Remove-GPOZaurrLegacyFiles' 'Remove-GPOZaurrLegacyFiles'
'Remove-GPOZaurrPermission' 'Remove-GPOZaurrPermission'
'Remove-GPOZaurrWMI' 'Remove-GPOZaurrWMI'
'Repair-GPOZaurrNetLogonOwner' 'Repair-GPOZaurrNetLogonOwner'
'Repair-GPOZaurrPermissionConsistency' 'Repair-GPOZaurrPermissionConsistency'
'Restore-GPOZaurr' 'Restore-GPOZaurr'
'Save-GPOZaurrFiles' 'Save-GPOZaurrFiles'
'Set-GPOOwner' 'Set-GPOOwner'
'Set-GPOZaurrOwner' 'Set-GPOZaurrOwner'
'Find-GPO' 'Find-GPO'
'Get-GPOZaurrFilesPolicyDefinitions' 'Get-GPOZaurrFilesPolicyDefinitions'
'Get-GPOZaurrSysvol' 'Get-GPOZaurrSysvol'
'Remove-GPOZaurrOrphaned' 'Remove-GPOZaurrOrphaned'
'Show-GPO' 'Show-GPO'
'Show-GPOZaurr' 'Show-GPOZaurr'
) )
New-ConfigurationCommand -ModuleName 'GroupPolicy' -CommandName @( New-ConfigurationCommand -ModuleName 'GroupPolicy' -CommandName @(
'Add-GPOPermission' 'Add-GPOPermission'
'Add-GPOZaurrPermission' 'Add-GPOZaurrPermission'
'Backup-GPOZaurr' 'Backup-GPOZaurr'
'Clear-GPOZaurrSysvolDFSR' 'Clear-GPOZaurrSysvolDFSR'
'ConvertFrom-CSExtension' 'ConvertFrom-CSExtension'
'Find-CSExtension' 'Find-CSExtension'
'Get-GPOZaurr' 'Get-GPOZaurr'
'Get-GPOZaurrAD' 'Get-GPOZaurrAD'
'Get-GPOZaurrBackupInformation' 'Get-GPOZaurrBackupInformation'
'Get-GPOZaurrBroken' 'Get-GPOZaurrBroken'
'Get-GPOZaurrDictionary' 'Get-GPOZaurrDictionary'
'Get-GPOZaurrDuplicateObject' 'Get-GPOZaurrDuplicateObject'
'Get-GPOZaurrFiles' 'Get-GPOZaurrFiles'
'Get-GPOZaurrFilesPolicyDefinition' 'Get-GPOZaurrFilesPolicyDefinition'
'Get-GPOZaurrFolders' 'Get-GPOZaurrFolders'
'Get-GPOZaurrInheritance' 'Get-GPOZaurrInheritance'
'Get-GPOZaurrLegacyFiles' 'Get-GPOZaurrLegacyFiles'
'Get-GPOZaurrLink' 'Get-GPOZaurrLink'
'Get-GPOZaurrLinkSummary' 'Get-GPOZaurrLinkSummary'
'Get-GPOZaurrNetLogon' 'Get-GPOZaurrNetLogon'
'Get-GPOZaurrOwner' 'Get-GPOZaurrOwner'
'Get-GPOZaurrPassword' 'Get-GPOZaurrPassword'
'Get-GPOZaurrPermission' 'Get-GPOZaurrPermission'
'Get-GPOZaurrPermissionConsistency' 'Get-GPOZaurrPermissionConsistency'
'Get-GPOZaurrPermissionRoot' 'Get-GPOZaurrPermissionRoot'
'Get-GPOZaurrPermissionSummary' 'Get-GPOZaurrPermissionSummary'
'Get-GPOZaurrSysvolDFSR' 'Get-GPOZaurrSysvolDFSR'
'Get-GPOZaurrWMI' 'Get-GPOZaurrWMI'
'Invoke-GPOZaurr' 'Invoke-GPOZaurr'
#'Invoke-GPOZaurrContent' #'Invoke-GPOZaurrContent'
'Invoke-GPOZaurrPermission' 'Invoke-GPOZaurrPermission'
'Invoke-GPOZaurrSupport' 'Invoke-GPOZaurrSupport'
'New-GPOZaurrWMI' 'New-GPOZaurrWMI'
'Optimize-GPOZaurr' 'Optimize-GPOZaurr'
'Remove-GPOPermission' 'Remove-GPOPermission'
'Remove-GPOZaurr' 'Remove-GPOZaurr'
'Remove-GPOZaurrBroken' 'Remove-GPOZaurrBroken'
'Remove-GPOZaurrDuplicateObject' 'Remove-GPOZaurrDuplicateObject'
'Remove-GPOZaurrFolders' 'Remove-GPOZaurrFolders'
'Remove-GPOZaurrLegacyFiles' 'Remove-GPOZaurrLegacyFiles'
'Remove-GPOZaurrPermission' 'Remove-GPOZaurrPermission'
'Remove-GPOZaurrWMI' 'Remove-GPOZaurrWMI'
'Repair-GPOZaurrNetLogonOwner' 'Repair-GPOZaurrNetLogonOwner'
'Repair-GPOZaurrPermissionConsistency' 'Repair-GPOZaurrPermissionConsistency'
'Restore-GPOZaurr' 'Restore-GPOZaurr'
'Save-GPOZaurrFiles' 'Save-GPOZaurrFiles'
'Set-GPOOwner' 'Set-GPOOwner'
'Set-GPOZaurrOwner' 'Set-GPOZaurrOwner'
'Find-GPO' 'Find-GPO'
'Get-GPOZaurrFilesPolicyDefinitions' 'Get-GPOZaurrFilesPolicyDefinitions'
'Get-GPOZaurrSysvol' 'Get-GPOZaurrSysvol'
'Remove-GPOZaurrOrphaned' 'Remove-GPOZaurrOrphaned'
'Show-GPO' 'Show-GPO'
'Show-GPOZaurr' 'Show-GPOZaurr'
) )
$ConfigurationFormat = [ordered] @{ $ConfigurationFormat = [ordered] @{
RemoveComments = $true RemoveComments = $true
RemoveEmptyLines = $true RemoveEmptyLines = $true
PlaceOpenBraceEnable = $true PlaceOpenBraceEnable = $true
PlaceOpenBraceOnSameLine = $true PlaceOpenBraceOnSameLine = $true
PlaceOpenBraceNewLineAfter = $true PlaceOpenBraceNewLineAfter = $true
PlaceOpenBraceIgnoreOneLineBlock = $false PlaceOpenBraceIgnoreOneLineBlock = $false
PlaceCloseBraceEnable = $true PlaceCloseBraceEnable = $true
PlaceCloseBraceNewLineAfter = $true PlaceCloseBraceNewLineAfter = $true
PlaceCloseBraceIgnoreOneLineBlock = $false PlaceCloseBraceIgnoreOneLineBlock = $false
PlaceCloseBraceNoEmptyLineBefore = $true PlaceCloseBraceNoEmptyLineBefore = $true
UseConsistentIndentationEnable = $true UseConsistentIndentationEnable = $true
UseConsistentIndentationKind = 'space' UseConsistentIndentationKind = 'space'
UseConsistentIndentationPipelineIndentation = 'IncreaseIndentationAfterEveryPipeline' UseConsistentIndentationPipelineIndentation = 'IncreaseIndentationAfterEveryPipeline'
UseConsistentIndentationIndentationSize = 4 UseConsistentIndentationIndentationSize = 4
UseConsistentWhitespaceEnable = $true UseConsistentWhitespaceEnable = $true
UseConsistentWhitespaceCheckInnerBrace = $true UseConsistentWhitespaceCheckInnerBrace = $true
UseConsistentWhitespaceCheckOpenBrace = $true UseConsistentWhitespaceCheckOpenBrace = $true
UseConsistentWhitespaceCheckOpenParen = $true UseConsistentWhitespaceCheckOpenParen = $true
UseConsistentWhitespaceCheckOperator = $true UseConsistentWhitespaceCheckOperator = $true
UseConsistentWhitespaceCheckPipe = $true UseConsistentWhitespaceCheckPipe = $true
UseConsistentWhitespaceCheckSeparator = $true UseConsistentWhitespaceCheckSeparator = $true
AlignAssignmentStatementEnable = $true AlignAssignmentStatementEnable = $true
AlignAssignmentStatementCheckHashtable = $true AlignAssignmentStatementCheckHashtable = $true
UseCorrectCasingEnable = $true UseCorrectCasingEnable = $true
} }
# format PSD1 and PSM1 files when merging into a single file # format PSD1 and PSM1 files when merging into a single file
# enable formatting is not required as Configuration is provided # enable formatting is not required as Configuration is provided
New-ConfigurationFormat -ApplyTo 'OnMergePSM1', 'OnMergePSD1' -Sort None @ConfigurationFormat New-ConfigurationFormat -ApplyTo 'OnMergePSM1', 'OnMergePSD1' -Sort None @ConfigurationFormat
# format PSD1 and PSM1 files within the module # format PSD1 and PSM1 files within the module
# enable formatting is required to make sure that formatting is applied (with default settings) # enable formatting is required to make sure that formatting is applied (with default settings)
New-ConfigurationFormat -ApplyTo 'DefaultPSD1', 'DefaultPSM1' -EnableFormatting -Sort None New-ConfigurationFormat -ApplyTo 'DefaultPSD1', 'DefaultPSM1' -EnableFormatting -Sort None
# when creating PSD1 use special style without comments and with only required parameters # when creating PSD1 use special style without comments and with only required parameters
New-ConfigurationFormat -ApplyTo 'DefaultPSD1', 'OnMergePSD1' -PSD1Style 'Minimal' New-ConfigurationFormat -ApplyTo 'DefaultPSD1', 'OnMergePSD1' -PSD1Style 'Minimal'
# configuration for documentation, at the same time it enables documentation processing # configuration for documentation, at the same time it enables documentation processing
New-ConfigurationDocumentation -Enable:$false -StartClean -UpdateWhenNew -PathReadme 'Docs\Readme.md' -Path 'Docs' New-ConfigurationDocumentation -Enable:$true -StartClean -UpdateWhenNew -SyncExternalHelpToProjectRoot -PathReadme 'Docs\Readme.md' -Path 'Docs'
#New-ConfigurationImportModule -ImportSelf #New-ConfigurationImportModule -ImportSelf
New-ConfigurationBuild -Enable:$true -SignModule -MergeModuleOnBuild -MergeFunctionsFromApprovedModules -CertificateThumbprint '483292C9E317AA13B07BB7A96AE9D1A5ED9E7703' New-ConfigurationBuild -Enable:$true -SignModule -MergeModuleOnBuild -MergeFunctionsFromApprovedModules -CertificateThumbprint '483292C9E317AA13B07BB7A96AE9D1A5ED9E7703'
# New-ConfigurationTest -TestsPath "$PSScriptRoot\..\Tests" -Enable # New-ConfigurationTest -TestsPath "$PSScriptRoot\..\Tests" -Enable
New-ConfigurationArtefact -Type Unpacked -Enable -Path "$PSScriptRoot\..\Artefacts\Unpacked" -AddRequiredModules New-ConfigurationArtefact -Type Unpacked -Enable -Path "$PSScriptRoot\..\Artefacts\Unpacked" -AddRequiredModules
New-ConfigurationArtefact -Type Packed -Enable -Path "$PSScriptRoot\..\Artefacts\Packed" -ArtefactName '<ModuleName>.v<ModuleVersion>.zip' -AddRequiredModules New-ConfigurationArtefact -Type Packed -Enable -Path "$PSScriptRoot\..\Artefacts\Packed" -ArtefactName '<ModuleName>.v<ModuleVersion>.zip' -AddRequiredModules
# options for publishing to github/psgallery # options for publishing to github/psgallery
#New-ConfigurationPublish -Type PowerShellGallery -FilePath 'C:\Support\Important\PowerShellGalleryAPI.txt' -Enabled:$true if (-not $SkipPublish) {
#New-ConfigurationPublish -Type GitHub -FilePath 'C:\Support\Important\GitHubAPI.txt' -UserName 'EvotecIT' -Enabled:$true New-ConfigurationPublish -Type PowerShellGallery -FilePath 'C:\Support\Important\PowerShellGalleryAPI.txt' -Enabled:$true
} -ExitCode New-ConfigurationPublish -Type GitHub -FilePath 'C:\Support\Important\GitHubAPI.txt' -UserName 'EvotecIT' -Enabled:$true
}
} -ExitCode