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_xPSSessionConfiguration.psm1: Fix Script Analyzer Issues #488

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

MSFT_xPSSessionConfiguration.psm1: Fix Script Analyzer Issues #488

mhendric opened this issue Jan 27, 2019 · 1 comment · Fixed by #543
Assignees
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_xPSSessionConfiguration.psm1. These should be fixed.

Verbose logs showing the problem

[00:04:26]     Context MSFT_xPSSessionConfiguration.psm1
[00:04:26]       [+] Should pass all error-level PS Script Analyzer rules 88ms
[00:04:27]       [+] Should pass all required PS Script Analyzer rules 1.47s
[00:04:28]       [+] Should pass all flagged PS Script Analyzer rules 148ms
[00:04:28]       [+] Should pass any recently-added, error-level PS Script Analyzer rules 60ms
[00:04:29]       [+] Should not suppress any required PS Script Analyzer rules 1.13s
[00:04:30] Custom DSC Resource Kit PSSA rule(s) did not pass.
[00:04:30] The following PSScriptAnalyzer rule 'DscResource.AnalyzerRules\Measure-ParameterBlockMandatoryNamedArgument' errors need to be fixed:
[00:04:30] MSFT_xPSSessionConfiguration.psm1 (Line 43): Mandatory parameters must use the correct format [Parameter(Mandatory = $true)] for the mandatory attribute. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:30] MSFT_xPSSessionConfiguration.psm1 (Line 136): Mandatory parameters must use the correct format [Parameter(Mandatory = $true)] for the mandatory attribute. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:30] MSFT_xPSSessionConfiguration.psm1 (Line 379): Mandatory parameters must use the correct format [Parameter(Mandatory = $true)] for the mandatory attribute. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:30] MSFT_xPSSessionConfiguration.psm1 (Line 517): Mandatory parameters must use the correct format [Parameter(Mandatory = $true)] for the mandatory attribute. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:30] MSFT_xPSSessionConfiguration.psm1 (Line 551): Mandatory parameters must use the correct format [Parameter(Mandatory = $true)] for the mandatory attribute. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:30] MSFT_xPSSessionConfiguration.psm1 (Line 555): Mandatory parameters must use the correct format [Parameter(Mandatory = $true)] for the mandatory attribute. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:30] MSFT_xPSSessionConfiguration.psm1 (Line 603): Mandatory parameters must use the correct format [Parameter(Mandatory = $true)] for the mandatory attribute. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:30] MSFT_xPSSessionConfiguration.psm1 (Line 776): Mandatory parameters must use the correct format [Parameter(Mandatory = $true)] for the mandatory attribute. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:30] MSFT_xPSSessionConfiguration.psm1 (Line 780): Mandatory parameters must use the correct format [Parameter(Mandatory = $true)] for the mandatory attribute. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:30] MSFT_xPSSessionConfiguration.psm1 (Line 784): Mandatory parameters must use the correct format [Parameter(Mandatory = $true)] for the mandatory attribute. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block
[00:04:30] The following PSScriptAnalyzer rule 'DscResource.AnalyzerRules\Measure-ParameterBlockParameterAttribute' errors need to be fixed:
[00:04:30] MSFT_xPSSessionConfiguration.psm1 (Line 141): 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:30] MSFT_xPSSessionConfiguration.psm1 (Line 145): 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:30] MSFT_xPSSessionConfiguration.psm1 (Line 148): 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:30] MSFT_xPSSessionConfiguration.psm1 (Line 151): 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:30] MSFT_xPSSessionConfiguration.psm1 (Line 155): 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:30] MSFT_xPSSessionConfiguration.psm1 (Line 383): 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:30] MSFT_xPSSessionConfiguration.psm1 (Line 386): 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:30] MSFT_xPSSessionConfiguration.psm1 (Line 388): 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:30] MSFT_xPSSessionConfiguration.psm1 (Line 390): 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:30] MSFT_xPSSessionConfiguration.psm1 (Line 393): 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:30] MSFT_xPSSessionConfiguration.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:30] MSFT_xPSSessionConfiguration.psm1 (Line 609): 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:30] MSFT_xPSSessionConfiguration.psm1 (Line 612): 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:30] MSFT_xPSSessionConfiguration.psm1 (Line 615): 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:30] MSFT_xPSSessionConfiguration.psm1 (Line 619): 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:30] For instructions on how to run PSScriptAnalyzer on your own machine, please go to https://github.com/powershell/PSScriptAnalyzer
[00:04:30] Common Tests - Custom Script Analyzer Rules will not fail unless you opt-in.
[00:04:30] To opt-in, create a '.MetaTestOptIn.json' at the root
[00:04:30] of the repo in the following format:
[00:04:30] [
[00:04:30]      "Common Tests - Custom Script Analyzer Rules"
[00:04:30] ]
[00:04:30]       [+] Should pass all custom DSC Resource Kit PSSA rules 850ms

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
@PlagueHO PlagueHO self-assigned this Feb 9, 2019
@PlagueHO PlagueHO 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 9, 2019
@PlagueHO
Copy link
Member

PlagueHO commented Feb 9, 2019

I've got this one.

mhendric added a commit that referenced this issue Feb 12, 2019
Resolve PSSA issues in xPSSessionConfiguration - Fixes #488
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.

2 participants