Fix New-IdleAuthSession: Export New-IdleAuthSessionBroker from IdLE.Core#126
Merged
Fix New-IdleAuthSession: Export New-IdleAuthSessionBroker from IdLE.Core#126
Conversation
…xports and add comprehensive tests Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix New-IdleAuthSession not recognized error
Fix New-IdleAuthSession: Export New-IdleAuthSessionBroker from IdLE.Core
Jan 30, 2026
blindzero
approved these changes
Jan 30, 2026
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a runtime failure where New-IdleAuthSession could not invoke IdLE.Core\New-IdleAuthSessionBroker because the underlying Core function was not exported from the IdLE.Core module manifest, and adds tests to catch similar issues in the future.
Changes:
- Added
New-IdleAuthSessionBrokertoFunctionsToExportinsrc/IdLE.Core/IdLE.Core.psd1so the Core broker function is available to theNew-IdleAuthSessionwrapper. - Introduced
tests/Core/New-IdleAuthSession.Tests.ps1to validateNew-IdleAuthSessionbehavior and its delegation toIdLE.Core\New-IdleAuthSessionBroker. - Added
tests/Core/ModuleExports.Tests.ps1to verify export consistency between.psm1Export-ModuleMemberdefinitions and.psd1FunctionsToExportfor bothIdLE.Coreand the top-levelIdLEmodule.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/IdLE.Core/IdLE.Core.psd1 |
Ensures New-IdleAuthSessionBroker is exported in the Core module manifest so the wrapper New-IdleAuthSession can call it via module qualification. |
tests/Core/New-IdleAuthSession.Tests.ps1 |
Adds Pester tests covering creation and usage of the auth session broker via New-IdleAuthSession, including session mapping, default credentials, and error behavior. |
tests/Core/ModuleExports.Tests.ps1 |
Adds Pester tests that check IdLE.Core and IdLE module export sets and ensure consistency between Export-ModuleMember in .psm1 files and FunctionsToExport in .psd1 manifests. |
…estore IDLE_ALLOW_INTERNAL_IMPORT Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
blindzero
approved these changes
Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New-IdleAuthSessionfails at runtime with "term 'IdLE.Core\New-IdleAuthSessionBroker' is not recognized" because the underlying Core function isn't exported from the module.Motivation
PowerShell module manifests (psd1) take precedence over
Export-ModuleMemberdirectives.New-IdleAuthSessionBrokerwas exported in the psm1 but missing fromFunctionsToExportin the psd1, making it inaccessible to the wrapper function.Type of Change
Changes
'New-IdleAuthSessionBroker'toFunctionsToExportinsrc/IdLE.Core/IdLE.Core.psd1tests/Core/New-IdleAuthSession.Tests.ps1- 9 tests covering cmdlet functionalitytests/Core/ModuleExports.Tests.ps1- 6 tests validating psm1/psd1 export consistency with proper environment variable cleanupTesting
How to test & review
Run tests:
Checklist
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.