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
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.0
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:
Running the following command in the dotnet core application works perfectly, so the problem seems to be limited the the dsc resources:
Import-Module PolicyFileEditorSteps to reproduce
Expected behavior
The DSC module is imported
Actual behavior
Environment data