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
Id #1334 | Release:
| Updated: Jan 28 at 4:49 PM by wojteksci | Created: Jan 28 at 2:15 PM by JeffHicks
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:
| Updated: Dec 16, 2015 at 2:45 PM by EnergizedTech | Created: Dec 16, 2015 at 2:45 PM by EnergizedTech
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:
| Updated: Feb 4 at 12:09 PM by DirkFolkers | Created: Dec 10, 2014 at 6:38 PM by Phil_B_StL
Analyzer 1.4 is still noting positional parameter use in some circumstances even when none are used.
$ClientContext = New-Object Microsoft.SharePoint.Client.CleintContext($uri)
I would e...
Id #1231 | Release:
| Updated: Nov 3, 2014 at 3:29 PM by JBinMN | Created: Nov 3, 2014 at 3:29 PM by JBinMN
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:
| Updated: Sep 16, 2015 at 10:36 PM by sAMAccountName | Created: Sep 23, 2014 at 3:02 PM by stestino
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:
| Updated: Nov 6, 2015 at 8:06 PM by JasonKindler | Created: Sep 23, 2014 at 2:53 PM by stestino
Lines that contain aliases aren't triggered for using positional parameters.
For instance, this only is flagged for the alias:
Id #1210 | Release:
| Updated: Sep 12, 2014 at 2:14 AM by MikeShepard | Created: Sep 12, 2014 at 2:13 AM by MikeShepard
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:
| Updated: Nov 6, 2015 at 8:06 PM by JasonKindler | Created: Aug 14, 2014 at 3:44 PM by reidcs
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:
| Updated: Sep 16, 2015 at 10:37 PM by sAMAccountName | Created: Jun 5, 2014 at 2:43 PM by mattmcnabb
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:
| Updated: Nov 6, 2015 at 8:06 PM by JasonKindler | Created: May 30, 2014 at 3:28 PM by alexbchalmers