diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4eeeaef9..398b9993 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -146,6 +146,12 @@ jobs: 'src/IdLE/IdLE.psd1', 'src/IdLE.Core/IdLE.Core.psd1', 'src/IdLE.Steps.Common/IdLE.Steps.Common.psd1', + 'src/IdLE.Steps.DirectorySync/IdLE.Steps.DirectorySync.psd1', + 'src/IdLE.Steps.Mailbox/IdLE.Steps.Mailbox.psd1', + 'src/IdLE.Provider.AD/IdLE.Provider.AD.psd1', + 'src/IdLE.Provider.EntraID/IdLE.Provider.EntraID.psd1', + 'src/IdLE.Provider.ExchangeOnline/IdLE.Provider.ExchangeOnline.psd1', + 'src/IdLE.Provider.DirectorySync.EntraConnect/IdLE.Provider.DirectorySync.EntraConnect.psd1', 'src/IdLE.Provider.Mock/IdLE.Provider.Mock.psd1' ) diff --git a/tools/New-IdleModulePackage.ps1 b/tools/New-IdleModulePackage.ps1 index 73f7d661..700e4e45 100644 --- a/tools/New-IdleModulePackage.ps1 +++ b/tools/New-IdleModulePackage.ps1 @@ -18,7 +18,12 @@ Repository root path. Defaults to the parent folder of this script directory. Target folder for the staged package. Defaults to '/artifacts/IdLE'. .PARAMETER NestedModuleNames -Names of nested modules to include under 'Modules/'. Defaults to IdLE.Core and IdLE.Steps.Common. +Names of nested modules to auto-import when IdLE is imported. Defaults to IdLE.Core and IdLE.Steps.Common. +These modules are automatically loaded when a user runs 'Import-Module IdLE'. + +.PARAMETER IncludeModuleNames +Names of all modules to include in the package under 'Modules/'. Defaults to all batteries-included modules. +These modules are available for explicit import but not all are auto-imported (see NestedModuleNames). Note: IdLE.Provider.Mock is published as a separate top-level module to ensure it is discoverable via Import-Module when installed from PowerShell Gallery. @@ -52,6 +57,9 @@ param( 'IdLE.Steps.Common' ), + [Parameter()] + [string[]] $IncludeModuleNames = $null, + [Parameter()] [switch] $Clean ) @@ -59,6 +67,20 @@ param( Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' +# Default IncludeModuleNames to all batteries-included modules if not specified +if ($null -eq $IncludeModuleNames -or $IncludeModuleNames.Count -eq 0) { + $IncludeModuleNames = @( + 'IdLE.Core', + 'IdLE.Steps.Common', + 'IdLE.Steps.DirectorySync', + 'IdLE.Steps.Mailbox', + 'IdLE.Provider.AD', + 'IdLE.Provider.EntraID', + 'IdLE.Provider.ExchangeOnline', + 'IdLE.Provider.DirectorySync.EntraConnect' + ) +} + function Resolve-IdleRepoRoot { [CmdletBinding()] param( @@ -195,14 +217,14 @@ Copy-IdleModuleFolder -SourcePath $idleSrc -DestinationPath $idleDst # 2) Stage nested modules into IdLE/Modules// Initialize-IdleDirectory -Path $modulesDst -foreach ($name in $NestedModuleNames) { +foreach ($name in $IncludeModuleNames) { $nestedSrc = Join-Path -Path $srcRoot -ChildPath $name $nestedDst = Join-Path -Path $modulesDst -ChildPath $name Copy-IdleModuleFolder -SourcePath $nestedSrc -DestinationPath $nestedDst } -# 3) Patch staged manifest to reference in-package nested module manifests +# 3) Patch staged manifest to reference in-package nested module manifests (auto-imported) $stagedManifest = Join-Path -Path $idleDst -ChildPath 'IdLE.psd1' $nestedEntries = Get-IdleNestedModuleEntryPaths -Names $NestedModuleNames Set-IdleNestedModulesInManifest -ManifestPath $stagedManifest -NestedModuleEntryPaths $nestedEntries