Skip to content

Commit 8066979

Browse files
Add module load by path
1 parent 8f5f866 commit 8066979

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/DscResource/PSResourceGetDSCResource.Tests.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ function SetupDsc {
3535

3636
$env:PATH += "$pathSeparator$resourcePath"
3737

38-
Import-Module $resourcePath -Verbose -Force
38+
$moduleToTest = Join-Path $resourcePath 'Microsoft.PowerShell.PSResource.psd1'
39+
40+
if (-not (Test-Path -Path $moduleToTest)) {
41+
throw "Module to test not found: $moduleToTest"
42+
}
43+
44+
Import-Module $moduleToTest -Verbose -Force
3945
}
4046

4147
function SetupTestRepos {

0 commit comments

Comments
 (0)