trondhindenes / AnsibleDscModuleGenerator

Scripts for generating Ansible modules from PowerShell DSC resources
MIT License
31 stars 2 forks source link

Warnings for code generated by the PSScriptAnalyzer tool #5

Closed it-praktyk closed 8 years ago

it-praktyk commented 8 years ago

[PS] >get-module psscriptanalyzer

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.7.0      PSScriptAnalyzer                    {Get-ScriptAnalyzerRule, Invoke-ScriptAnalyzer}

[PS] >Invoke-ScriptAnalyzer .\AnsibleWinModuleGen.ps1 | Select RuleName,Serverity,Line,Message | fl

RuleName  : PSPossibleIncorrectComparisonWithNull
Serverity :
Line      : 91
Message   : $null should be on the left side of equality comparisons.

RuleName  : PSAvoidUsingCmdletAliases
Serverity :
Line      : 39
Message   : 'where' is an alias of 'Where-Object'. Alias can introduce possible problems and make scripts hard to
            maintain. Please consider changing alias to its full content.

RuleName  : PSAvoidUsingCmdletAliases
Serverity :
Line      : 43
Message   : 'foreach' is an alias of 'ForEach-Object'. Alias can introduce possible problems and make scripts hard to
            maintain. Please consider changing alias to its full content.

RuleName  : PSAvoidUsingCmdletAliases
Serverity :
Line      : 44
Message   : 'foreach' is an alias of 'ForEach-Object'. Alias can introduce possible problems and make scripts hard to
            maintain. Please consider changing alias to its full content.

RuleName  : PSAvoidUsingCmdletAliases
Serverity :
Line      : 56
Message   : 'Select' is an alias of 'Select-Object'. Alias can introduce possible problems and make scripts hard to
            maintain. Please consider changing alias to its full content.

RuleName  : PSAvoidUsingCmdletAliases
Serverity :
Line      : 66
Message   : 'Select' is an alias of 'Select-Object'. Alias can introduce possible problems and make scripts hard to
            maintain. Please consider changing alias to its full content.

RuleName  : PSAvoidUsingCmdletAliases
Serverity :
Line      : 144
Message   : 'where' is an alias of 'Where-Object'. Alias can introduce possible problems and make scripts hard to
            maintain. Please consider changing alias to its full content.

RuleName  : PSUseDeclaredVarsMoreThanAssignments
Serverity :
Line      : 289
Message   : The variable 'counter' is assigned but never used.
it-praktyk commented 8 years ago

Please check 0cb9d9607b20b513d0820c535554910a65c8075b - I prepared correction and skeleton for comment based help.

Will you accept my pull request for that?

it-praktyk commented 8 years ago

Resolved #8