Skip to content

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

Merged
merged 8 commits into from
May 19, 2015

Conversation

yutingc
Copy link
Contributor

@yutingc yutingc commented May 18, 2015

No description provided.

/// <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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Braces for conditional statements

Copy link
Contributor Author

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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

psscriptanalyzer

Copy link
Contributor Author

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);

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.

Copy link
Contributor Author

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.

@yutingc
Copy link
Contributor Author

yutingc commented May 18, 2015

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.

@raghushantha
Copy link
Member

Signoff

yutingc added a commit that referenced this pull request May 19, 2015
…ields

Avoid using deprecated manifest fields
@yutingc yutingc merged commit 2e27554 into development May 19, 2015
@vors vors removed the in progress label May 19, 2015
@yutingc
Copy link
Contributor Author

yutingc commented May 19, 2015

Thanks!

@yutingc yutingc deleted the AvoidUsingDeprecatedManifestFields branch May 19, 2015 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants