File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 37
37
Export-ModuleMember -Function PublicFunction
38
38
39
39
# The test script:
40
+ BeforeAll {
41
+ Import-Module MyModule
42
+ }
40
43
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 {
46
47
PrivateFunction | Should -Be $true
47
48
}
48
49
}
51
52
52
53
Normally you would not be able to access "PrivateFunction" from
53
54
the PowerShell session, because the module only exported
54
- "PublicFunction". Using InModuleScope allowed this call to
55
+ "PublicFunction". Using InModuleScope allowed this call to
55
56
"PrivateFunction" to work successfully.
56
57
57
58
. EXAMPLE
You can’t perform that action at this time.
0 commit comments