PowerShell / PSScriptAnalyzer

Download ScriptAnalyzer from PowerShellGallery
https://www.powershellgallery.com/packages/PSScriptAnalyzer/
MIT License
1.87k stars 378 forks source link

Profile parameter should take a hash table #351

Closed juneb closed 8 years ago

juneb commented 9 years ago

The Profile parameter takes a hash table in a .psd1 text file or a hash table in a variable, but it does not take a hash table as the parameter value.

raghushantha commented 9 years ago

Quoc. Please take a look at this..

juneb commented 9 years ago

Actually, it doesn't take a hash table in a variable either. I thought it would based on the example in Readme.md, but the command returns a warning.

PS C:\ps-test> $myprofile

Name Value


IncludeRules {PSAvoidUsingCmdletAliases, PSAvoidUsingPositionalParameters, PSAvoidUsingInternalURLs, PSAv... ExcludeRules {PSAvoidUsingCmdletAliases, PSAvoidUninitializedVariable} Severity Warning

PS C:\ps-test> Invoke-ScriptAnalyzer -Path $modulePath -Profile $myprofile WARNING: Cannot find file 'System.Collections.Hashtable'.

RuleName Severity FileName Line Message


PSProvideCommentHelp Information ManageProf 24 The cmdlet 'Enable-Profile' does not have a help comment. iles.psm1 PSProvideCommentHelp Information ManageProf 12 The cmdlet 'Disable-Profile' does not have a help comment. iles.psm1 PSProvideCommentHelp Information ManageProf 7 The cmdlet 'Get-Profile' does not have a help comment. iles.psm1

quoctruong commented 8 years ago

Closed with https://github.com/PowerShell/PSScriptAnalyzer/pull/404