Skip to content

Commit 48edaf0

Browse files
author
Andrew
committed
feedback 1
1 parent 15f8111 commit 48edaf0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

dsc/tests/dsc_osinfo.tests.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,22 @@ Describe 'Tests for osinfo examples' {
1919
$out.results[0].result.inDesiredState | Should -Be $IsMacOS
2020
}
2121

22-
It 'Verify dsc home directory is added to PATH to find included resources' {
22+
It 'Verify dsc home directory is added to PATH to find included resources' -Tag z1{
2323
$oldPath = $env:PATH
24+
$oldLocation = Get-Location
2425
try {
25-
$exe_path = Resolve-Path "$PSScriptRoot/../../bin/debug"
26-
# Remove unwanted elements
26+
$exe_path = (Get-Command dsc).Path | Split-Path
27+
$exe_path | Split-Path | Set-Location
28+
# Remove exe_path from PATH if it is there
2729
$new_path = ($oldPath.Split([System.IO.Path]::PathSeparator) | Where-Object { $_ -ne $exe_path }) -join [System.IO.Path]::PathSeparator
2830
$env:PATH = $new_path
2931

30-
$null = & "$PSScriptRoot/../../bin/debug/dsc" config test -p "$PSScriptRoot/../examples/osinfo_parameters.dsc.yaml"
32+
$null = & "$exe_path/dsc" config test -p "$PSScriptRoot/../examples/osinfo_parameters.dsc.yaml"
3133
$LASTEXITCODE | Should -Be 0
3234
}
3335
finally {
3436
$env:PATH = $oldPath
37+
$oldLocation | Set-Location
3538
}
3639
}
3740
}

0 commit comments

Comments
 (0)