File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 20
20
if ($lines.Count -ne 0 ) {
21
21
$result = $scriptModule.invoke ( { param ($lines ) Build-DscConfigDocument - Content $lines }, ($lines | Out-String ) )
22
22
23
- ($result | ConvertTo-Json - Depth 10 - Compress) | Write-DscTrace Debug
24
-
25
23
return ($result | ConvertTo-Json - Depth 10 - Compress)
26
24
}
27
25
}
Original file line number Diff line number Diff line change @@ -33,8 +33,6 @@ BeforeDiscovery {
33
33
34
34
Describe ' PowerShell extension tests' {
35
35
It ' Example PowerShell file should work' - Skip:(! $IsWindows -or ! $isElevated ) {
36
- Write-Verbose - Message $env: PSModulePath - Verbose
37
-
38
36
$psFile = Resolve-Path - Path " $PSScriptRoot \..\..\dsc\examples\variable.dsc.ps1"
39
37
$out = dsc - l trace config get -f $psFile 2> $TestDrive / error.log | ConvertFrom-Json
40
38
$LASTEXITCODE | Should - Be 0 - Because (Get-Content - Path $TestDrive / error.log - Raw | Out-String )
@@ -59,7 +57,7 @@ configuration InvalidConfiguration {
59
57
dsc - l trace config get -f $psFile 2> $TestDrive / error.log
60
58
$LASTEXITCODE | Should - Be 2 - Because (Get-Content - Path $TestDrive / error.log - Raw | Out-String )
61
59
$content = (Get-Content - Path $TestDrive / error.log - Raw)
62
- $content | Should - BeLike " *Importing file '$psFile ' with extension 'Microsoft.DSC.Extension/PowerShell '*"
60
+ $content | Should - BeLike " *Importing file '$psFile ' with extension 'Microsoft.DSC.Extension/WindowsPowerShell '*"
63
61
$content | Should -Match " No DSC resources found in the imported modules."
64
62
}
65
63
}
@@ -69,5 +67,7 @@ AfterAll {
69
67
Install-PSResource - Name ' PSDesiredStateConfiguration' - Version 2.0 .7 - ErrorAction Stop - TrustRepository - Reinstall
70
68
}
71
69
70
+ Write-Verbose - Message " Restoring original PSModulePath" - Verbose
71
+ Write-Verbose - Message ($script :currentModulePaths ) - Verbose
72
72
$env: PSModulePath = $script :currentModulePaths
73
73
}
You can’t perform that action at this time.
0 commit comments