You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function Initialize-TestEnvironment tries to import the specified module. However, if that module is using the ScriptsToProcess parameter in the PSD1 file, the function throws an error. I have tracked this down to the following line:
In that case the Import-Module cmdlet returns two modules, resulting in $ModuleUnderTest to become an array instead of a string. All subsequent don't expect this scenario and fail.
The function Initialize-TestEnvironment tries to import the specified module. However, if that module is using the ScriptsToProcess parameter in the PSD1 file, the function throws an error. I have tracked this down to the following line:
DscResource.Test/source/Public/Initialize-TestEnvironment.ps1
Line 119 in 75778b9
In that case the Import-Module cmdlet returns two modules, resulting in $ModuleUnderTest to become an array instead of a string. All subsequent don't expect this scenario and fail.
The solution is to add Where-Object to the line:
Will submit a PR to correct this issue.
The text was updated successfully, but these errors were encountered: