mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Update CimDSCParser to fix Configuration compilation for DSC (#6225)
Update CimDSCParser to fix Configuration compilation for DSC
This commit is contained in:
@@ -663,7 +663,18 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal
|
||||
}
|
||||
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");
|
||||
@@ -704,7 +715,7 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user