@@ -8,7 +8,7 @@ Describe "Resolve DSC Resource Dependency" {
8
8
$skipTest = $true
9
9
return
10
10
}
11
- $SavedPSModulePath = $env: PSModulePath
11
+ $savedPSModulePath = $env: PSModulePath
12
12
$violationFileName = ' MissingDSCResource.ps1'
13
13
$violationFilePath = Join-Path $directory $violationFileName
14
14
$testRootDirectory = Split-Path - Parent $directory
@@ -27,7 +27,7 @@ Describe "Resolve DSC Resource Dependency" {
27
27
}
28
28
AfterAll {
29
29
if ( $skipTest ) { return }
30
- $env: PSModulePath = $SavedPSModulePath
30
+ $env: PSModulePath = $savedPSModulePath
31
31
}
32
32
33
33
Context " Module handler class" {
@@ -58,7 +58,7 @@ Describe "Resolve DSC Resource Dependency" {
58
58
$expectedPssaAppDataPath = Join-Path $depHandler.LocalAppDataPath " PSScriptAnalyzer"
59
59
$depHandler.PSSAAppDataPath | Should - Be $expectedPssaAppDataPath
60
60
61
- $expectedPSModulePath = $oldPSModulePath + [System.IO.Path ]::PathSeparator + $depHandler.TempModulePath
61
+ $expectedPSModulePath = $savedPSModulePath + [System.IO.Path ]::PathSeparator + $depHandler.TempModulePath
62
62
$env: PSModulePath | Should - Be $expectedPSModulePath
63
63
64
64
$depHandler.Dispose ()
@@ -178,7 +178,7 @@ Describe "Resolve DSC Resource Dependency" {
178
178
# Save the current environment variables
179
179
$oldLocalAppDataPath = $env: LOCALAPPDATA
180
180
$oldTempPath = $env: TEMP
181
- $oldPSModulePath = $env: PSModulePath
181
+ $savedPSModulePath = $env: PSModulePath
182
182
183
183
# set the environment variables
184
184
$tempPath = Join-Path $oldTempPath ([guid ]::NewGUID()).ToString()
@@ -208,7 +208,7 @@ Describe "Resolve DSC Resource Dependency" {
208
208
209
209
AfterAll {
210
210
if ( $skipTest ) { return }
211
- $env: PSModulePath = $oldPSModulePath
211
+ $env: PSModulePath = $savedPSModulePath
212
212
}
213
213
214
214
It " has a single parse error" - skip:$skipTest {
@@ -222,7 +222,7 @@ Describe "Resolve DSC Resource Dependency" {
222
222
223
223
It " Keeps PSModulePath unchanged before and after invocation" - skip:$skipTest {
224
224
$dr = Invoke-ScriptAnalyzer - Path $violationFilePath - ErrorVariable parseErrors - ErrorAction SilentlyContinue
225
- $env: PSModulePath | Should - Be $oldPSModulePath
225
+ $env: PSModulePath | Should - Be $savedPSModulePath
226
226
}
227
227
228
228
if (! $skipTest )
0 commit comments