Allows you to execute parts of a test script within the scope of a PowerShell script module.
By injecting some test code into the scope of a PowerShell script module, you can use non-exported functions, aliases and variables inside that module, to perform unit tests on its internal implementation.
InModuleScope may be used anywhere inside a Pester script, either inside or outside a Describe block.
Normally you would not be able to access "PrivateFunction" from the PowerShell session, because the module only exported "PublicFunction". Using InModuleScope allowed this call to "PrivateFunction" to work successfully.
The name of the module into which the test code should be injected. This module must already be loaded into the current PowerShell session.
The code to be executed within the script module.
A optional hashtable of parameters to be passed to the scriptblock.
A optional list of arguments to be passed to the scriptblock.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
This page was auto-generated using the comment based help in Pester 5.1.1. To edit the content of this page, change the corresponding help in the pester/Pester repository. See our contribution guide for more information.