Skip to content

PSScriptAnalyzer v1.18.1

Compare
Choose a tag to compare
@bergmeister bergmeister released this 18 Jun 21:12
· 263 commits to master since this release
b1a8187

Please see the CHANGELOG for information about the changes in the release. You can download this version from PowerShellGallery.

Fixes

  • Formatter

    • UseCorrectCasing
      • Do not use alias name as key for command info cache to fix the problem where UseCorrectCasing corrects aliases (#1216) (by @bergmeister)
      • Fix wildcard lookups for command lookup and do not append .exe for applications on Windows (#1210) (by @bergmeister)
      • Do not correct applications or script paths at all (#1255) (by @bergmeister)
    • Prevent PSCloseBrace crash if hashtable definition start on first token and there is a PSCloseBrace violation (#1235) (by @bergmeister)
    • PipelineIndentationStyle
      • Fix formatting regression in 1.18.0 whereby single-line pipeline reduces indentation level incorrectly (#1191) (by @bergmeister)
      • Make IncreaseIndentationForFirstPipeline the true default option for PipelineIndentationStyle option (#1218) (by @bergmeister)
  • Compatibility Rules

    • Fix UseCompatibleSyntax class error message (#1215) (by @rjmholt)
    • Convert compatibility module to binary module, fix compatibility with Azure environments (#1212) (by @rjmholt)
    • Prevent .NET members with names differing only by case from crashing the compatibility profiler (#1195) (by @rjmholt)
    • Fix compatibility profile query API so that aliases referring to other modules appear (#1194) (by @rjmholt)
  • DSC

    • Instead of using the first cimClass and then having no superClass, use the first cimClass that has a non-null superClass (#1200) (by @bergmeister, thanks to @ykuijs! for the great collaboration)
    • Make -SaveDscDependency work on Linux (#1246) (by @bergmeister)
  • Enable suppression of custom rules when used together with -IncludeDefaultRules to allow all possible scenarios from 1.17.1 and 1.18.0. This removes also the check if the rule name in the suppression attribute can be found because this check is technically not possible in all scenarios (#1245) (by @bergmeister)

  • Fix NullReferenceException for class type (#1182) (by @bergmeister)

Performance

2 improvements were made that make cold runs of ScriptAnalyzer twice as fast compared to 1.18.0

  • Speedup cold runs by using a runspace pool (#1178) (by @bergmeister)
  • Fix logic errors in AvoidAlias rule to halve the amount of necessary calls to Get-Command, making the rule twice (#1251) (by @JamesWTruher)

General Improvements

  • Add ImplementingType to RuleInfo object for better settings file validation and settings template file creation (#1250) (by @JamesWTruher)
  • Fix typo in AvoidDefaultValueForMandatoryParameterError resource string (#1233) (Thanks @tnieto88!)
  • Change module root find function in CompatibilityRule (#1196) (by @rjmholt)

Documentation

Build