Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add whats new for PSSA #215

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions reference/docs-conceptual/PSScriptAnalyzer/whats-new-in-pssa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
description: This article lists the updates to the PSScriptAnalyzer module.
ms.date: 04/04/2024
title: What's new in PSScriptAnalyzer
---
# What's new in PSScriptAnalyzer

PSScriptAnalyzer is a static code checker for PowerShell modules and scripts. This article outlines
the changes in each version of PSScriptAnalyzer.

## PSScriptAnalyzer 1.22.0 - 2024-03-05

PSScriptAnalyzer works with Windows PowerShell 5.1 and PowerShell 7. The minimum required version
when using PowerShell 7 is now `7.2.11`.

### New rules

- `PSAvoidUsingAllowUnencryptedAuthentication` rule to warn about outdated authentication methods.
- `PSAvoidExclaimOperator` rule to warn about the use of the `!` negation operator.

### Enhancements

- Enable suppression of `PSAvoidAssignmentToAutomaticVariable` for specific variable or parameter
- Upgrade to use .NET 6 since PowerShell 7.0 is now out out of support
- Convert `PSUseSingularNouns` to configurable rule and add `Windows` to allowlist
- Allow suppression of `PSUseSingularNouns` for specific function
- Add `ErrorView` to `SpecialVars.cs`
- Adding `ToString()` methods to `[CorrectionExtent]` and `[DiagnosticRecord]` types
- Add `PSNativeCommandUseErrorActionPreference` preference variable
- `AvoidUsingPositionalParameter` - Check if command has parameters to avoid having `az` in default
**CommandAllowList**
- `PSReviewUnusedParameter` - Add **CommandsToTraverse** option

## PSScriptAnalyzer 1.21.0 - 2022-09-27

### New Rule

- Add `AvoidMultipleTypeAttributes` rule to warn about multiple type attributes on a parameter.
- Add `AvoidSemicolonsAsLineTerminators` rule to warn about lines ending with a semicolon.
- Add `AvoidUsingBrokenHashAlgorithms` rule to warn about the use of insecure hash algorithms.

### Enhancements

- Return suggestion to use **PSCredential** for `AvoidUsingPlainTextForPassword` rule
- `Invoke-Formatter` - Accept input from pipeline
- Make messages of `UseCorrectCasing` more detailed
- Exclude automatic variable `$FormatEnumerationLimit` from analysis by `PSAvoidGlobalVars` and
`PSUseDeclaredVarsMoreThanAssignments`
- `PSAvoidUsingPositionalParameters` - Do not warn on AZ CLI

## PSScriptAnalyzer 1.20.0 - 2021-08-20

### New rules

- Make `UseSingularNouns` rule work in PowerShell 7
- `UseConsistentWhitespace` - Create option to ignore assignment operator inside hashtable

### Enhancements

- Replace unhelpful warning about `process` aliasing `Get-Process` with warning about misused syntax
- Fix `FunctionInfo` fallback AST attribute analysis for `UseShouldProcessCorrectly`
- Do not increase indentation after a left parenthesis if the previous token is a newline and the
next token is not a newline
- `UseConsistentWhitespace` - **CheckOpenBrace** setting to not warn when being preceded by open
parenthesis
- Implement `-IncludeSuppressions` parameter
- Combine multiple suppressions applied to the same diagnostic

## PSScriptAnalyzer 1.19.1 - 2020-07-28

### New rules

- Add `AvoidUsingDoubleQuotesForConstantString` (disabled by default) to warn about the use of
double quotes for constant strings

### Fixes

- `UseCorrectCasing` - Do not use **CommandInfoCache** when **CommandInfoParameters** property
throws due to runspace affinity problem of PowerShell engine
- `ReviewUnusedParameter` - Do not trigger when `$MyInvocation.BoundParameters` or
`$PSCmdlet.MyInvocation.BoundParameters` is used
- `PipelineIndentationStyle.None` - Fix bug that caused incorrect formatting in hashtables
- `UseUsingScopeModifierInNewRunspaces` - Fix `ArgumentException` when the same variable name is
used in 2 different sessions.
- `UseConsistentWhitespace`
- Check previous token only if it starts on the same line
- Fix **CheckParameter** bug when using interpolated string

## Previous versions

For information about the changes in previous versions of PSScriptAnalyzer, see the PSScriptAnalyzer
[CHANGELOG][01].

<!-- link references -->
[01]: https://github.com/PowerShell/PSScriptAnalyzer/blob/master/CHANGELOG.MD
18 changes: 11 additions & 7 deletions reference/docs-conceptual/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ items:
href: Crescendo/get-started/create-new-cmdlet.md
- name: Generate and test a Crescendo module
href: Crescendo/get-started/generate-module.md
- name: What's new
- name: What's new in Crescendo
items:
- name: What's new in Crescendo 1.1
href: Crescendo/whats-new/whats-new-in-crescendo-11.md
Expand All @@ -39,12 +39,16 @@ items:
items:
- name: Overview
href: PSScriptAnalyzer/overview.md
- name: Using PSScriptAnalyzer
href: PSScriptAnalyzer/using-scriptanalyzer.md
- name: Rules and recommendations
href: PSScriptAnalyzer/rules-recommendations.md
- name: Creating custom rules
href: PSScriptAnalyzer/create-custom-rule.md
- name: What's new in PSScriptAnalyzer
href: PSScriptAnalyzer/whats-new-in-pssa.md
- name: How to
items:
- name: Using PSScriptAnalyzer
href: PSScriptAnalyzer/using-scriptanalyzer.md
- name: Rules and recommendations
href: PSScriptAnalyzer/rules-recommendations.md
- name: Creating custom rules
href: PSScriptAnalyzer/create-custom-rule.md
- name: Rules reference
items:
- name: Rules overview
Expand Down