Rule suggestion: Identify hard coded variables

I would like a way to identify hard coded variables, not including default values for parameters. I want to be able to identify a lines of code like this: $domain = "contoso.com" $age = 30 A line...

Id #1334 | Release: None | Updated: Jan 28 at 4:49 PM by wojteksci | Created: Jan 28 at 2:15 PM by JeffHicks

Flag Cmdlets / Functions that don't provide Help

I'm not sure how you'd code this, but I think one of the big rules to add in (Especially for modules going to the PowerShell Gallery) is flagging Cmdlets that don't provide any help. Even if the...

Id #1328 | Release: None | Updated: Dec 16, 2015 at 2:45 PM by EnergizedTech | Created: Dec 16, 2015 at 2:45 PM by EnergizedTech

Unreferenced variables

Could you flag unreferenced variable names in a script. Such that if you defined a variable in the start of the script and then never referenced the variable it might be an indicator that the varia...

Id #1238 | Release: None | Updated: Feb 4 at 12:09 PM by DirkFolkers | Created: Dec 10, 2014 at 6:38 PM by Phil_B_StL

Error with positional parameter analysis

Analyzer 1.4 is still noting positional parameter use in some circumstances even when none are used. Example: $ClientContext = New-Object Microsoft.SharePoint.Client.CleintContext($uri) I would e...

Id #1231 | Release: None | Updated: Nov 3, 2014 at 3:29 PM by JBinMN | Created: Nov 3, 2014 at 3:29 PM by JBinMN

Flag lines that contain Write-Host.

Using Write-Host is almost never correct. Script Analyzer should flag on Write-Host usage and give us the ability to toggle the rule off and on.

Id #1218 | Release: None | Updated: Sep 16, 2015 at 10:36 PM by sAMAccountName | Created: Sep 23, 2014 at 3:02 PM by stestino

Flag lines that contain backticks.

Using backticks ( ` ) for line continuation is almost never correct. Script Analyzer should flag on line continuation backtick usage and give us the ability to toggle the rule off and on.

Id #1217 | Release: None | Updated: Nov 6, 2015 at 8:06 PM by JasonKindler | Created: Sep 23, 2014 at 2:53 PM by stestino

Error with positional parameters and aliases

Lines that contain aliases aren't triggered for using positional parameters. For instance, this only is flagged for the alias: function test{ dir c:\$a }

Id #1210 | Release: None | Updated: Sep 12, 2014 at 2:14 AM by MikeShepard | Created: Sep 12, 2014 at 2:13 AM by MikeShepard

Rule Suggestion: Warning on using existing name for functions

Highlight any functions that use the same name as a built-in function or alias. Use of such functions is dangerous as it would override the behaviour of any existing code that expect the functiona...

Id #1194 | Release: None | Updated: Nov 6, 2015 at 8:06 PM by JasonKindler | Created: Aug 14, 2014 at 3:44 PM by reidcs

Configurable Options for Cmdlet Alias Rule

I suggest that the cmdlet alias rule be configurable. It is somewhat generally accepted to use aliases for the -Object cmdlets such as Where-Object and Select-Object, so options to configure cmdlet...

Id #1156 | Release: None | Updated: Sep 16, 2015 at 10:37 PM by sAMAccountName | Created: Jun 5, 2014 at 2:43 PM by mattmcnabb

Rule Suggestion: Prefer single quotes for non-expanding strings

Single quotes are preferred for string literals without expansion. It would be helpful for Script Analyzer to detect instances of strings and here-strings that are double quoted and do not encapsu...

Id #1135 | Release: None | Updated: Nov 6, 2015 at 8:06 PM by JasonKindler | Created: May 30, 2014 at 3:28 PM by alexbchalmers