File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,23 @@ function SetupDsc {
1717 }
1818
1919 $script :dscExe = Get-Command - name dsc - CommandType Application | Select-Object - First 1
20+
21+ $loadedPSResourceGet = Get-Module PSResourceGet - ErrorAction SilentlyContinue
22+ $resources = Get-ChildItem $loadedPSResourceGet.ModuleBase /* resource.json - ErrorAction SilentlyContinue
23+
24+ if (-not $script :dscExe ) {
25+ throw " Could not find dsc executable in PATH after setup."
26+ }
27+
28+ if (-not $resources.Count -ge 2 ) {
29+ throw " Expected at least 2 resource schema files in PSResourceGet module directory, found $ ( $resources.Count ) ."
30+ }
31+
32+ $resourcePath = Split-Path $resources [0 ].FullName - Parent
33+
34+ Write-Verbose - Verbose " Adding DSC resource path to PATH environment variable: $resourcePath "
35+
36+ $env: PATH += " $pathSeparator$resourcePath "
2037}
2138
2239function SetupTestRepos {
You can’t perform that action at this time.
0 commit comments