PSScriptAnalyzer
1.17.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.
Minimum PowerShell version
3.0
Installation Options
Owners
Copyright
(c) Microsoft Corporation 2016. All rights reserved.
Package Details
Author(s)
- Microsoft Corporation
Tags
Cmdlets
Get-ScriptAnalyzerRule Invoke-ScriptAnalyzer Invoke-Formatter
Dependencies
This module has no dependencies.
Release Notes
### New Parameters
- Add `-ReportSummary` switch (#895) (Thanks @StingyJack! for the base work that got finalized by @bergmeister)
- Add `-EnableExit` switch to Invoke-ScriptAnalyzer for exit and return exit code for CI purposes (#842) (by @bergmeister)
- Add `-Fix` switch to `-Path` parameter set of `Invoke-ScriptAnalyzer` (#817, #852) (by @bergmeister)
### New Rules and Warnings
- Warn when 'Get-' prefix was omitted in `AvoidAlias` rule. (#927) (by @bergmeister)
- `AvoidAssignmentToAutomaticVariable`. NB: Currently only warns against read-only automatic variables (#864, #917) (by @bergmeister)
- `PossibleIncorrectUsageOfRedirectionOperator` and `PossibleIncorrectUsageOfAssignmentOperator`. (#859, #881) (by @bergmeister)
- Add PSAvoidTrailingWhitespace rule (#820) (Thanks @dlwyatt!)
### Fixes and Improvements
- AvoidDefaultValueForMandatoryParameter triggers when the field has specification: Mandatory=value and value!=0 (#969) (by @kalgiz)
- Do not trigger UseDeclaredVarsMoreThanAssignment for variables being used via Get-Variable (#925) (by @bergmeister)
- Make UseDeclaredVarsMoreThanAssignments not flag drive qualified variables (#958) (by @bergmeister)
- Fix PSUseDeclaredVarsMoreThanAssignments to not give false positives when using += operator (#935) (by @bergmeister)
- Tweak UseConsistentWhiteSpace formatting rule to exclude first unary operator when being used in argument (#949) (by @bergmeister)
- Allow -Setting parameter to resolve setting presets as well when object is still a PSObject in BeginProcessing (#928) (by @bergmeister)
- Add macos detection to New-CommandDataFile (#947) (Thanks @GavinEke!)
- Fix PlaceOpenBrace rule correction to take comment at the end of line into account (#929) (by @bergmeister)
- Do not trigger UseShouldProcessForStateChangingFunctions rule for workflows (#923) (by @bergmeister)
- Fix parsing the -Settings object as a path when the path object originates from an expression (#915) (by @bergmeister)
- Allow relative settings path (#909) (by @bergmeister)
- Fix AvoidDefaultValueForMandatoryParameter documentation, rule and tests (#907) (by @bergmeister)
- Fix NullReferenceException in AlignAssignmentStatement rule when CheckHashtable is enabled (#838) (by @bergmeister)
- Fix FixPSUseDeclaredVarsMoreThanAssignments to also detect variables that are strongly typed (#837) (by @bergmeister)
- Fix PSUseDeclaredVarsMoreThanAssignments when variable is assigned more than once to still give a warning (#836) (by @bergmeister)
### Engine, Building and Testing
- Allow TypeNotFound parser errors (#957) (by @bergmeister)
- Scripts needed to build and sign PSSA via MS VSTS so it can be published in the gallery (#983) (by @JamesWTruher)
- Move common test code into AppVeyor module (#961) (by @bergmeister)
- Remove extraneous import-module commands in tests (#962) (by @JamesWTruher)
- Upgrade 'System.Automation.Management' NuGet package of version 6.0.0-alpha13 to version 6.0.2 from powershell-core feed, which requires upgrade to netstandard2.0. NB: This highly improved behavior on WMF3 but also means that the latest patched version (6.0.2) of PowerShell Core should be used. (#919) by @bergmeister)
- Add Ubuntu Build+Test to Appveyor CI (#940) (by @bergmeister)
- Add PowerShell Core Build+Test to Appveyor CI (#939) (by @bergmeister)
- Update Newtonsoft.Json NuGet package of Rules project from 9.0.1 to 10.0.3 (#937) (by @bergmeister)
- Fix Pester v4 installation for `Visual Studio 2017` image and use Pester v4 assertion operator syntax (#892) (by @bergmeister)
- Have a single point of reference for the .Net Core SDK version (#885) (by @bergmeister)
- Fix regressions introduced by PR 882 (#891) (by @bergmeister)
- Changes to allow tests to be run outside of CI (#882) (by @JamesWTruher)
- Upgrade platyPS from Version 0.5 to 0.9 (#869) (by @bergmeister)
- Build using .Net Core SDK 2.1.101 targeting `netstandard2.0` and `net451` (#853, #854, #870, #899, #912, #936) (by @bergmeister)
- Add instructions to make a release (#843) (by @kapilmb)
### Documentation, Error Messages and miscellaneous Improvements
- Added Chocolatey Install help, which has community support (#999) (Thanks @pauby)
- Finalize Release Logs and bump version to 1.17 (#998) (by @bergmeister)
- Docker examples: (#987, #990) (by @bergmeister)
- Use multiple GitHub issue templates for bugs, feature requests and support questions (#986) (by @bergmeister
- Fix table of contents (#980) (by @bergmeister)
- Improve documentation, especially about parameter usage and the settings file (#968) (by @bergmeister)
- Add base changelog for 1.17.0 (#967) (by @bergmeister)
- Remove outdated about_scriptanalyzer help file (#951) (by @bergmeister)
- Fixes a typo and enhances the documentation for the parameters required for script rules (#942) (Thanks @MWL88!)
- Remove unused using statements and sort them (#931) (by @bergmeister)
- Make licence headers consistent across all .cs files by using the recommended header of PsCore (#930) (by @bergmeister)
- Update syntax in ReadMe to be the correct one from get-help (#932) by @bergmeister)
- Remove redundant, out of date Readme of RuleDocumentation folder (#918) (by @bergmeister)
- Shorten contribution section in ReadMe and make it more friendly (#911) (by @bergmeister)
- Update from Pester 4.1.1 to 4.3.1 and use new -BeTrue and -BeFalse operators (#906) (by @bergmeister)
- Fix Markdown in ScriptRuleDocumentation.md so it renders correctly on GitHub web site (#898) (Thanks @MWL88!)
- Fix typo in .Description for Measure-RequiresModules (#888) (Thanks @TimCurwick!)
- Use https links where possible (#873) (by @bergmeister)
- Make documentation of AvoidUsingPositionalParameters match the implementation (#867) (by @bergmeister)
- Fix PSAvoidUsingCmdletAliases warnings of internal build/release scripts in root and Utils folder (#872) (by @bergmeister)
- Add simple GitHub Pull Request template based off the one for PowerShell Core (#866) (by @bergmeister)
- Add a simple GitHub issue template based on the one of PowerShell Core. (#865, #884) (by @bergmeister)
- Fix Example 7 in Invoke-ScriptAnalyzer.md (#862) (Thanks @sethvs!)
- Use the typewriter apostrophe instead the typographic apostrophe (#855) (Thanks @alexandear!)
- Add justification to ReadMe (#848) (Thanks @KevinMarquette!)
- Fix typo in README (#845) (Thanks @misterGF!)
FileList
- PSScriptAnalyzer.nuspec
- Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll
- Microsoft.Windows.PowerShell.ScriptAnalyzer.dll
- Newtonsoft.Json.dll
- PSScriptAnalyzer.cat
- PSScriptAnalyzer.psd1
- PSScriptAnalyzer.psm1
- ScriptAnalyzer.format.ps1xml
- ScriptAnalyzer.types.ps1xml
- coreclr\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll
- coreclr\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll
- en-US\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll-Help.xml
- PSv3\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll
- PSv3\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll
- PSv3\Newtonsoft.Json.dll
- PSv4\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll
- PSv4\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll
- PSv4\Newtonsoft.Json.dll
- Settings\CmdletDesign.psd1
- Settings\CodeFormatting.psd1
- Settings\CodeFormattingAllman.psd1
- Settings\CodeFormattingOTBS.psd1
- Settings\CodeFormattingStroustrup.psd1
- Settings\core-6.0.2-linux.json
- Settings\core-6.0.2-macos.json
- Settings\core-6.0.2-windows.json
- Settings\desktop-3.0-windows.json
- Settings\desktop-4.0-windows.json
- Settings\desktop-5.1.14393.206-windows.json
- Settings\DSC.psd1
- Settings\PSGallery.psd1
- Settings\ScriptFunctions.psd1
- Settings\ScriptingStyle.psd1
- Settings\ScriptSecurity.psd1
Version History
Version | Downloads | Last updated |
---|---|---|
1.24.0 | 840,163 | 3/18/2025 |
1.23.0 | 1,111,835 | 10/9/2024 |
1.22.0 | 967,256 | 2/27/2024 |
1.21.0 | 1,457,012 | 9/29/2022 |
1.20.0 | 915,710 | 8/24/2021 |
1.19.1 | 704,836 | 7/28/2020 |
1.19.0 | 188,694 | 5/4/2020 |
1.18.3 | 512,448 | 9/16/2019 |
1.18.2 | 26,825 | 9/3/2019 |
1.18.1 | 114,302 | 6/13/2019 |
1.18.0 | 156,492 | 3/21/2019 |
1.17.1 | 234,335 | 6/5/2018 |
1.16.1 | 110,182 | 9/5/2017 |
1.16.0 | 5,659 | 8/16/2017 |
1.15.0 | 22,077 | 6/21/2017 |
1.14.1 | 2,658 | 6/12/2017 |
1.14.0 | 905 | 6/9/2017 |
1.13.0 | 6,490 | 5/18/2017 |
1.12.0 | 2,280 | 5/9/2017 |
1.11.1 | 7,100 | 4/4/2017 |
1.11.0 | 8,516 | 3/1/2017 |
1.10.0 | 6,215 | 1/19/2017 |
1.9.0 | 5,685 | 12/6/2016 |
1.8.1 | 7,201 | 10/14/2016 |
1.8.0 | 1,267 | 10/8/2016 |
1.7.0 | 5,218 | 8/18/2016 |
1.6.0 | 28,817 | 6/7/2016 |
1.5.0 | 5,064 | 3/30/2016 |
1.4.0 | 3,098 | 2/17/2016 |
1.3.0 | 1,213 | 1/19/2016 |
1.2.0 | 12,634 | 12/16/2015 |
1.1.1 | 884 | 11/4/2015 |
1.1.0 | 872 | 9/1/2015 |
1.0.2 | 601 | 6/24/2015 |
1.0.1 | 495 | 5/8/2015 |
1.0 | 464 | 4/24/2015 |