Skip to content
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

MSFT_xUserResource.psm1: Fix Custom DSC Resource Kit PSSA rule violations #492

Closed
mhendric opened this issue Jan 27, 2019 · 1 comment · Fixed by #553
Closed

MSFT_xUserResource.psm1: Fix Custom DSC Resource Kit PSSA rule violations #492

mhendric opened this issue Jan 27, 2019 · 1 comment · Fixed by #553
Labels
enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone.

Comments

@mhendric
Copy link
Contributor

Details of the scenario you tried and the problem that is occurring

There's a number of script analyzer issues getting reported in MSFT_xUserResource.psm1. These should be fixed.

Verbose logs showing the problem

[00:04:52]     Context MSFT_xUserResource.psm1
[00:04:52]       [+] Should pass all error-level PS Script Analyzer rules 89ms
[00:04:54] Required PSSA rule(s) did not pass.
[00:04:54] The following PSScriptAnalyzer rule 'PSPossibleIncorrectComparisonWithNull' errors need to be fixed:
[00:04:54] MSFT_xUserResource.psm1 (Line 503): $null should be on the left side of equality comparisons.
[00:04:54] For instructions on how to run PSScriptAnalyzer on your own machine, please go to https://github.com/powershell/PSScriptAnalyzer
[00:04:54] Common Tests - Required Script Analyzer Rules will not fail unless you opt-in.
[00:04:54] To opt-in, create a '.MetaTestOptIn.json' at the root
[00:04:54] of the repo in the following format:
[00:04:54] [
[00:04:54]      "Common Tests - Required Script Analyzer Rules"
[00:04:54] ]
[00:04:54]       [+] Should pass all required PS Script Analyzer rules 2.04s
[00:04:55]       [+] Should pass all flagged PS Script Analyzer rules 329ms
[00:04:55]       [+] Should pass any recently-added, error-level PS Script Analyzer rules 67ms
[00:04:57]       [+] Should not suppress any required PS Script Analyzer rules 1.79s
[00:04:58] Custom DSC Resource Kit PSSA rule(s) did not pass.
[00:04:58] The following PSScriptAnalyzer rule 'DscResource.AnalyzerRules\Measure-ParameterBlockParameterAttribute' errors need to be fixed:
[00:04:58] MSFT_xUserResource.psm1 (Line 98): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 102): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 105): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 108): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 113): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 116): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 119): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 122): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 181): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 185): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 188): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 191): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 196): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 199): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 202): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 205): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 340): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 344): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 347): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 350): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 355): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 358): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 361): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 364): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 582): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 586): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 589): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 592): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 597): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 600): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 603): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 606): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 728): The [Parameter()] attribute must start with an upper case 'P'. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 829): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 833): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 836): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 839): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 844): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 847): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 850): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 853): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 1038): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 1042): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 1045): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 1048): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 1053): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 1056): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 1059): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 1062): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] MSFT_xUserResource.psm1 (Line 1258): A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:58] For instructions on how to run PSScriptAnalyzer on your own machine, please go to https://github.com/powershell/PSScriptAnalyzer
[00:04:58] Common Tests - Custom Script Analyzer Rules will not fail unless you opt-in.
[00:04:58] To opt-in, create a '.MetaTestOptIn.json' at the root
[00:04:58] of the repo in the following format:
[00:04:58] [
[00:04:58]      "Common Tests - Custom Script Analyzer Rules"
[00:04:58] ]
[00:04:58]       [+] Should pass all custom DSC Resource Kit PSSA rules 884ms

Version of the DSC module that was used ('dev' if using current dev branch)

dev

@mhendric mhendric added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Jan 27, 2019
@mhendric mhendric changed the title MSFT_xUserResource.psm1: Fix Script Analyzer Issues MSFT_xUserResource.psm1: Fix Custom DSC Resource Kit PSSA rule violations Feb 12, 2019
@mhendric
Copy link
Contributor Author

I got this one.

@mhendric mhendric added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant