From 4656f3c07267f5df3c19cecfbed02336a1bd636f Mon Sep 17 00:00:00 2001 From: John Kordich Date: Mon, 8 Aug 2016 13:30:02 -0700 Subject: [PATCH] Adding error message letting the user know they need to install PSDSC for Linux --- src/System.Management.Automation/DscSupport/CimDSCParser.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/System.Management.Automation/DscSupport/CimDSCParser.cs b/src/System.Management.Automation/DscSupport/CimDSCParser.cs index 302502507c..bcaa9e3fd7 100644 --- a/src/System.Management.Automation/DscSupport/CimDSCParser.cs +++ b/src/System.Management.Automation/DscSupport/CimDSCParser.cs @@ -645,7 +645,10 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal var dscConfigurationDirectory = Environment.GetEnvironmentVariable("DSC_HOME") ?? "/etc/opt/omi/conf/dsc/configuration"; - Debug.Assert(Directory.Exists(dscConfigurationDirectory), dscConfigurationDirectory + " does not exist."); + if (!Directory.Exists(dscConfigurationDirectory)) + { + throw new DirectoryNotFoundException("Unable to find DSC schema store at " + dscConfigurationDirectory + ". Please ensure PS DSC for Linux is installed."); + } var resourceBaseFile = Path.Combine(dscConfigurationDirectory, "baseregistration/baseresource.schema.mof"); ImportClasses(resourceBaseFile, s_defaultModuleInfoForResource, errors);