-
Notifications
You must be signed in to change notification settings - Fork 395
Avoid using deprecated manifest fields #177
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
Conversation
/// <returns>A List of diagnostic results of this rule</returns> | ||
public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName) | ||
{ | ||
if (ast == null) throw new ArgumentNullException(Strings.NullAstErrorMessage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces for conditional statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@{ | ||
|
||
# Script module or binary module file associated with this manifest. | ||
ModuleToProcess ='scriptanalyzer' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
psscriptanalyzer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
{ | ||
foreach (var warning in result) | ||
{ | ||
yield return new DiagnosticRecord(String.Format(CultureInfo.CurrentCulture, warning.BaseObject.ToString()), ast.Extent, GetName(), DiagnosticSeverity.Warning, fileName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there going to be a null pointer exception if the baseobject is null? If I remember correctly, we got this bug somewhere before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I've added a null check for that.
I've compared the manifest file generated by PS V2.0 and V5.0 and seems like the only deprecated field is "ModuleToProcess". PSV5.0 introduced new fields such as "DscResourcesToExport".. I've updated the error description. |
Signoff |
…ields Avoid using deprecated manifest fields
Thanks! |
No description provided.