Skip to content

Commit 3a7958d

Browse files
author
Steve Lee (POWERSHELL HE/HIM) (from Dev Box)
committed
fix test
1 parent e64f94c commit 3a7958d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dsc/tests/dsc_extension_discover.tests.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ Describe 'Discover extension tests' {
133133
try {
134134
# exclude finding powershell.exe
135135
$oldPath = $env:PATH
136-
$env:PATH = "$env:PROGRAMFILES\PowerShell\7"
137-
$out = dsc resource list 2> $TestDrive/error.log | ConvertFrom-Json
136+
$dscFolder = Split-Path (Get-Command dsc).Source -Parent
137+
$env:PATH = "$env:PROGRAMFILES\PowerShell\7;$dscFolder"
138+
$out = dsc -l warn resource list 2> $TestDrive/error.log | ConvertFrom-Json
138139
$LASTEXITCODE | Should -Be 0
139140
$out.Count | Should -BeGreaterThan 0
140141
(Get-Content -Path "$TestDrive/error.log" -Raw) | Should -BeLike "*WARN Extension 'Microsoft.Windows.Appx/Discover' failed to discover resources: Command: Operation program not found for executable 'powershell'*" -Because (Get-Content -Path "$TestDrive/error.log" -Raw | Out-String)

0 commit comments

Comments
 (0)