8000 Update CimDSCParser to fix Configuration compilation for DSC by mbreakey3 · Pull Request #6225 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Update CimDSCParser to fix Configuration compilation for DSC #6225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/System.Management.Automation/DscSupport/CimDSCParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,18 @@ public static void Initialize(Collection<Exception> errors, List<string> moduleP
}
else
{
var systemResourceRoot = Path.Combine(Platform.GetFolderPath(Environment.SpecialFolder.System), "Configuration");
// DSC SxS scenario
var configSystemPath = Utils.DefaultPowerShellAppBase;
var systemResourceRoot = Path.Combine(configSystemPath, "Configuration");
var inboxModulePath = "Modules\\PSDesiredStateConfiguration";

if (!Directory.Exists(systemResourceRoot))
{
configSystemPath = Platform.GetFolderPath(Environment.SpecialFolder.System);
systemResourceRoot = Path.Combine(configSystemPath, "Configuration");
inboxModulePath = InboxDscResourceModulePath;
}

var programFilesDirectory = Platform.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
Debug.Assert(programFilesDirectory != null, "Program Files environment variable does not exist!");
var customResourceRoot = Path.Combine(programFilesDirectory, "WindowsPowerShell\\Configuration");
Expand Down Expand Up @@ -708,7 +719,7 @@ public static void Initialize(Collection<Exception> errors, List<string> moduleP
List<string> modulePaths = new List<string>();
if (modulePathList == null || modulePathList.Count == 0)
{
modulePaths.Add(Path.Combine(Platform.GetFolderPath(Environment.SpecialFolder.System), InboxDscResourceModulePath));
modulePaths.Add(Path.Combine(configSystemPath, inboxModulePath));
isInboxResource = true;
}
else
Expand Down
0