CimDscParser: Add better error message when a file is not found (#5838)

This commit is contained in:
Travis Plunk 2018-01-10 18:16:41 -08:00 committed by GitHub
parent a08f3241a3
commit db10411505
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -368,7 +368,8 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration
if (!File.Exists(fullFilePath))
{
throw PSTraceSource.NewArgumentException("fullFilePath");
var errorMessage = string.Format(CultureInfo.CurrentCulture, ParserStrings.FileNotFound, fullFilePath);
throw PSTraceSource.NewArgumentException(nameof(fullFilePath), errorMessage);
}
using (FileStream fs = File.OpenRead(fullFilePath))