PSScriptAnalyzer

1.2.0

PSScriptAnalyzer provides script analysis and checks for potential code defects in the scripts by applying a group of built-in or customized rules on the scripts being analyzed.

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name PSScriptAnalyzer -RequiredVersion 1.2.0

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name PSScriptAnalyzer -Version 1.2.0

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) Microsoft Corporation 2015. All rights reserved.

Package Details

Author(s)

  • Microsoft Corporation

Cmdlets

Get-ScriptAnalyzerRule Invoke-ScriptAnalyzer

Dependencies

This module has no dependencies.

Release Notes

Released v1.2.0 (Dec.17, 2015)

Features:
- Support for consuming PowerShell content as streams (-ScriptDefinition)
- ScriptAnalyzer accepts configuration (settings) in the form of a hashtable (-Settings), added sample Settings
- Ability to run default ruleset along with custom ones in the same invocation (-IncludeDefaultRules)
- Recurse Custom Rule Paths (-RecurseCustomRulePath)
- Consistent Engine error handling when working with Settings, Default and Custom Rules

Rules:
- Rule to detect the presence of default value for Mandatory parameters (AvoidDefaultValueForMandatoryParameter)

Fixes:
Engine:
- Engine update to prevent script based injection attacks
- CustomizedRulePath is now called CustomRulePath – Fixes to handle folder paths
- Fixes for RecurseCustomRulePath functionality
- Fix to binplace cmdlet help file as part of build process
- ScriptAnalyzer Profile is now called Settings
- Fix to emit filename in the diagnosticrecord when using Script based custom rules
- Fix to prevent Engine from calling Update-Help for script based custom rules
- Added additional pester tests to take care of test holes in Custom Rule feature
- Post-build error handling improvements, fixed typos in the project

Rules:
- Fixed bug in Positional parameter rule to trigger only when used with > 3 positional  - parameters
- Updated keywords that trigger PSAvoidUsingPlainTextForPassword rule
- Updated ProvideDefaultParameterValue rule to AvoidDefaultValueForMandatoryParameter rule
- Deprecate Internal Url rule based on community feedback, identified additional rules to handle hardcoded paths etc
- Added localhost exceptions for HardCodedComputerName Rule
- Update to Credential based rules to validate the presence of CredentialAttribute and PSCredential type

Documentation:
- Rule & Cmdlet documentation updates – Cmdlet help file addition

FileList

Version History

Version Downloads Last updated
1.22.0 174,887 2/27/2024
1.21.0 1,344,877 9/29/2022
1.20.0 853,707 8/24/2021
1.19.1 684,396 7/28/2020
1.19.0 183,634 5/4/2020
1.18.3 490,426 9/16/2019
1.18.2 25,360 9/3/2019
1.18.1 111,782 6/13/2019
1.18.0 154,633 3/21/2019
1.17.1 233,443 6/5/2018
1.16.1 109,651 9/5/2017
1.16.0 5,649 8/16/2017
1.15.0 22,065 6/21/2017
1.14.1 2,649 6/12/2017
1.14.0 894 6/9/2017
1.13.0 6,481 5/18/2017
1.12.0 2,271 5/9/2017
1.11.1 7,089 4/4/2017
1.11.0 8,416 3/1/2017
1.10.0 6,202 1/19/2017
1.9.0 5,472 12/6/2016
1.8.1 7,173 10/14/2016
1.8.0 1,258 10/8/2016
1.7.0 5,205 8/18/2016
1.6.0 28,798 6/7/2016
1.5.0 5,038 3/30/2016
1.4.0 3,085 2/17/2016
1.3.0 1,203 1/19/2016
1.2.0 (current version) 12,551 12/16/2015
1.1.1 872 11/4/2015
1.1.0 861 9/1/2015
1.0.2 590 6/24/2015
1.0.1 479 5/8/2015
1.0 444 4/24/2015
Show less