Skip to content

Commit 81d46ce

Browse files
authored
Update example for InModuleScope (#2631)
1 parent 25548db commit 81d46ce

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Diff for: src/functions/InModuleScope.ps1

+7-6
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@
3737
Export-ModuleMember -Function PublicFunction
3838
3939
# The test script:
40+
BeforeAll {
41+
Import-Module MyModule
42+
}
4043
41-
Import-Module MyModule
42-
43-
InModuleScope MyModule {
44-
Describe 'Testing MyModule' {
45-
It 'Tests the Private function' {
44+
Describe 'Testing MyModule' {
45+
It 'Tests the Private function' {
46+
InModuleScope MyModule {
4647
PrivateFunction | Should -Be $true
4748
}
4849
}
@@ -51,7 +52,7 @@
5152
5253
Normally you would not be able to access "PrivateFunction" from
5354
the PowerShell session, because the module only exported
54-
"PublicFunction". Using InModuleScope allowed this call to
55+
"PublicFunction". Using InModuleScope allowed this call to
5556
"PrivateFunction" to work successfully.
5657
5758
.EXAMPLE

0 commit comments

Comments
 (0)