-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Area-DSCDesired State Configuration issuesDesired State Configuration issuesResolution-FixedThe issue is fixed.The issue is fixed.
Description
When trying to build a configuration in a dotnet core application, I can't get it to import the required modules.
Running the following script in a PSCore console works but when running it in a dotnet application it can't find the module:
Configuration Test {
Import-DscResource -ModuleName PolicyFileEditor
}
Running the following command in the dotnet core application works perfectly, so the problem seems to be limited the the dsc resources:
Import-Module PolicyFileEditor
Steps to reproduce
using (PowerShell ps = PowerShell.Create())
{
string configScript = "Configuration Test { Import-DscResource -ModuleName PolicyFileEditor }";
ps.AddScript(configScript);
ps.Invoke();
}
Expected behavior
The DSC module is imported
Actual behavior
At line:2 char:1
+ Import-DscResource -ModuleName PolicyFileEditor
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Could not find the module 'PolicyFileEditor'.
Environment data
Name Value
---- -----
PSVersion 6.0.0-beta
PSEdition Core
GitCommitId v6.0.0-beta.4
OS Microsoft Windows 10.0.15063
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Metadata
Metadata
Assignees
Labels
Area-DSCDesired State Configuration issuesDesired State Configuration issuesResolution-FixedThe issue is fixed.The issue is fixed.