Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)

Expand Down
28 changes: 25 additions & 3 deletions tools/New-IdleModulePackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ Repository root path. Defaults to the parent folder of this script directory.
Target folder for the staged package. Defaults to '<RepoRootPath>/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.

Expand Down Expand Up @@ -52,13 +57,30 @@ param(
'IdLE.Steps.Common'
),

[Parameter()]
[string[]] $IncludeModuleNames = $null,

[Parameter()]
[switch] $Clean
)

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(
Expand Down Expand Up @@ -195,14 +217,14 @@ Copy-IdleModuleFolder -SourcePath $idleSrc -DestinationPath $idleDst
# 2) Stage nested modules into IdLE/Modules/<ModuleName>/
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
Expand Down
Loading