Skip to content

Conversation

@rulasg
Copy link
Owner

@rulasg rulasg commented Sep 18, 2025

Introduce a helper function to enable testing of private functions within the module by executing scriptblocks in the module's context. This addition enhances the testing capabilities without exposing internal functions.

# THIS INCLUDE REQUIRES module.helper.ps1
if(-not $MODULE_PATH){ throw "Missing MODULE_PATH variable initialization. Check for module.helper.ps1 file." }

function Invoke-PrivateContext {

Check notice

Code scanning / PSScriptAnalyzer

The cmdlet 'Invoke-PrivateContext' does not have a help comment. Note

The cmdlet 'Invoke-PrivateContext' does not have a help comment.
throw "Failed to import the main module."
}

& $module $ScriptBlock

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
@rulasg rulasg merged commit 13af3ce into main Sep 18, 2025
3 checks passed
@rulasg rulasg deleted the callPrivateFunctios branch September 18, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants