From ce36556a2a5010de552e0353d214fcd9e89f2d0a Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Tue, 12 Mar 2019 21:51:27 +0000 Subject: [PATCH 1/7] Changelog for 1.18.0 --- CHANGELOG.MD | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 26700273d..2b1944157 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,95 @@ -## [1.17.1](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.17.1) - 2018-06-06 +# CHANGELOG + +## [1.18.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.18.0) - 2019-03-?? + +### Breaking Changes + +- Minimum required version of `PowerShell Core` was raised from `6.0.2` to `6.1.0` due to `6.0` having reached the end of it's support life-cycle. (#1165) +- Updated used version of `Newtonsoft.Json` to `11.0.2`. (#1165) (by @bergmeister) +- Command data files of PowerShell `6.0.2` were removed. Updated files for PowerShell `6.1.0` were added. This means that users that have customized the `UseCompatibleCmdlets` rule, need to either adapt the version string as per rule documentation or can alternatively copy in the old command data files into the `Settings` installation folder (#1075) (by @bergmeister) +- The minimum required runtime of the full .Net Framework was raised from `4.5.1` to `4.5.2` as `4.5.1` is not supported any more. If the OS is patched then Windows update will have ensured that the newer runtime patch is available. (#1108) (by @bergmeister) + +### Formatter Rules + +- Add `UseCorrectCasing` formatting rule for cmdlet/function name (#1117) (by @bergmeister) +- Fix `PSUseConsistentIndentationRule` to handle pipes correctly when there is a multi-line statement after a pipe and add `PipelineIndentation` customisation option for it (#1102) (by @bergmeister) +- Add `CheckInnerBrace` and `CheckPipe` options to `PSUseConsistentWhitespace` (#1092) (by @bergmeister) + +### Script Analysis Rules + +- Add command data file for PowerShell `2.0` (#1091) (by @bergmeister) +- Add Command data files of PowerShell `6.1.0` (#1075) (by @bergmeister) +- New PowerShell compatibility rules: `UseCompatibleCommands`, `UseCompatibleSyntax` and `UseCompatibleTypes` (#1156 and #1133) (by @rjmholt) +- Make `PossibleIncorrectComparisonWithNull` rule return a `SuggestCorrection` for auto-fixes in VS-Code or via the -Fix switch (#1115) (by @bergmeister) +- Make UseCompatibleCmdlets not throw if default reference desktop-5.1.14393.206-windows is specified in the list of platforms and use core-6.1.0-windows as an alternative default reference (#1043 and #1075) (by @bergmeister) + +### Custom Rules + +- Translate `RuleSuppressionID` for custom rules as well (#1144) (by @bergmeister) +- Allow for suppression of custom rules (#1145) (by @bergmeister) + +### DSC + +- Add support for Hashtable syntax of `Import-DscRessource` for `-SaveDscDependency` switch (#1138) (by @bergmeister) +- Take module version into account for `-SaveDscDependency` switch (#1094) (by @bergmeister) + +### Performance + +Multi-threading efficiency was highly improved leading to a speedup whilst keeping the CPU usage roughly the same. One can expect `PSScriptAnalyzer` (PSSA) `1.18` to be more than twice as fast in most situations (including 'cold' runs) compared to its predecessor 1.17.0. + +- Increase lock granularity for CommandInfo cache #1166 (by @bergmeister and @rjmholt) +- Restore caching in Helper.GetCommandInfo (#1074) (Thanks @SeeminglyScience!) + +### Fixes and General Improvements + +- Fix bug when culture was set to Turkish (#1095) (by @bergmeister) +- Fix settings file array parsing when no commas are present (#1161) (by @rjmholt) +- Ensure correct disposal with using statement (#1164) (by @bergmeister) +- Emit parsing errors as diagnostic records (#1130) (by @JamesWTruher) +- Make Invoke-Formatter cleanup its state in the same way as Invoke-ScriptAnalyzer does to avoid knock on effect on Invoke-ScriptAnalyzer when Invoke-Formatter is being called (#1121) (by @bergmeister) +- Fix parsing of empty hashtable when string is provided as settings object (#1073) (by @bergmeister) +- Fix AlignAssignment rule to calculate alignment position correctly and avoid crash (#1070) (by @bergmeister) +- Don't crash on CIM classes with no superclass (#1046) (Thanks @edyoung!) +- Trigger AvoidPositionalParameters rule for function defined and called inside a script. (#963) (Thanks @kalgiz!) +- Add OutputType attributes to cmdlets to enhance tab completion (#1020) (by @bergmeister) +- Allow paths to be pipelined to Invoke-ScriptAnalyzer (#1040) (Thanks @edyoung!) +- PSGallery will no longer use PSAvoidUsingConvertToSecureStringWithPlainText and PSAvoidUsingUserNameAndPasswordParams rules (#1037) (Thanks @edyoung!) + +### Build + +- Raise minimum required PS version of PS 6 to `6.1.0` due to 6.0 running out of support now and update Newtonsoft.Json to `11.0.2` (#1165) (by @bergmeister) +- Unify reference to `Microsoft.Management.Infrastructure` and update `System.Reflection.TypeExtensions` NuGet package (#1105) (by @bergmeister) +- Update .Net Core SDK from 2.2.103 to `2.2.104` (latest patch) (#1158) (by @bergmeister) +- Make it easier to install the dotnet CLI tools (#1139) (by @JamesWTruher) +- Simplify build scripts even more and upgrade platyPS in Appveyor #1088 (by @bergmeister) +- Upgrade .Net SDK to 2.2.102 to fix new test failures on AppVeyor's Ubuntu image due an image update (#1128) (by @bergmeister) +- Mark setting files as content for easier out-of-the-box debugging (#1104) (by @bergmeister) +- Upgrade from net451 to net452 since net451 is not supported any more and net452 is an in-place upgrade anyway (#1108) (by @bergmeister) +- Install dotnet sdk if missing on Unix as well to fix failing Ubuntu build due to image update and Pester/PowerShell bug (#1107) (by @bergmeister) +- Removes update of pwsh since appveyor images are updated (#1084) (Thanks @wilmardo!) +- Update, simplify, and consolidate build scripts (#1082) (by @JamesWTruher) +- Bump .Net Core SDK version to 2.1.401 (#1086) (Thanks @wilmardo!) +- Use RTM version of `Microsoft.Management.Infrastructure` (#1059) (by @bergmeister) +- Upgrade `Microsoft.PowerShell.5.ReferenceAssemblies` from 1.0.0 to `1.1.0` and remove redundant/transitive references (#1050) (by @bergmeister) +- Remove RuntimeFrameworkVersion as this is given by the running version of PS anyway and .Net would upgrade automatically anyway if possible (#1052) (by @bergmeister) +- Upgrade Nuget packages (`System.Reflection.TypeExtensions` and `Microsoft.CSharp`) and make them more consistent (#1051) (by @bergmeister) +- give explicit error on unsupported versions of pscore and document it (#1049) (by @bergmeister) +- Remove old and redundant test settings file core-6.0.0-alpha-windows.json (#1044) (by @bergmeister) +- Use `TLS 1.2` for bootstrapping dotnet in CI (#1047) (by @bergmeister) +- Remove redundant/outdated build scripts and cleanup (#1011) (by @bergmeister) +- Upload only out folder as artifact, which is the actual PSSA artifact (#1009) (by @bergmeister) + +### Documentation + +- Fix the "How" section #1127 (Thanks @alexandair!) +- Make the correct example use the declared variable (#1111) (Thanks @f0nt4!) +- Correcting CommunityRules to `CommunityAnalyzerRules` (#1119) (Thanks @kvprasoon!) +- Add summary comment to some rules with short description (#1087) (Thanks @pedrocodacy!) +- Update PR template to be more similar to the one of PowerShell but still distinguish where necessary (#1077) +- Update documentation of `PSUseConsistentWhiteSpace`: enhance example and correct argument type. #1069 (Thanks @TheIncorrigible1!) +- Update AvoidNullOrEmptyHelpMessageAttribute.md fix typo (#1068) (Thanks @TheIncorrigible1!) + + ## [1.17.1](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.17.1) - 2018-06-06 ### Fixes From 5d269ba380fb7b307e679b77f4f346ee991c7405 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Wed, 13 Mar 2019 07:28:29 +0000 Subject: [PATCH 2/7] Apply suggestions from code review Co-Authored-By: bergmeister --- CHANGELOG.MD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 2b1944157..60542f0f7 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -18,7 +18,7 @@ ### Script Analysis Rules - Add command data file for PowerShell `2.0` (#1091) (by @bergmeister) -- Add Command data files of PowerShell `6.1.0` (#1075) (by @bergmeister) +- Add command data files of PowerShell `6.1.0` (#1075) (by @bergmeister) - New PowerShell compatibility rules: `UseCompatibleCommands`, `UseCompatibleSyntax` and `UseCompatibleTypes` (#1156 and #1133) (by @rjmholt) - Make `PossibleIncorrectComparisonWithNull` rule return a `SuggestCorrection` for auto-fixes in VS-Code or via the -Fix switch (#1115) (by @bergmeister) - Make UseCompatibleCmdlets not throw if default reference desktop-5.1.14393.206-windows is specified in the list of platforms and use core-6.1.0-windows as an alternative default reference (#1043 and #1075) (by @bergmeister) @@ -35,7 +35,7 @@ ### Performance -Multi-threading efficiency was highly improved leading to a speedup whilst keeping the CPU usage roughly the same. One can expect `PSScriptAnalyzer` (PSSA) `1.18` to be more than twice as fast in most situations (including 'cold' runs) compared to its predecessor 1.17.0. +Multi-threading efficiency was highly improved leading to a speedup whilst keeping the CPU usage roughly the same. One can expect `PSScriptAnalyzer` (PSSA) 1.18.0 to be more than twice as fast in most situations (including 'cold' runs) compared to its predecessor 1.17.0. - Increase lock granularity for CommandInfo cache #1166 (by @bergmeister and @rjmholt) - Restore caching in Helper.GetCommandInfo (#1074) (Thanks @SeeminglyScience!) From 815e9cd2ff83109a9b20bc41fd7a1d5e4dd73b60 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Wed, 13 Mar 2019 07:38:35 +0000 Subject: [PATCH 3/7] Update CHANGELOG.MD Co-Authored-By: bergmeister --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 60542f0f7..997a68ff9 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -4,7 +4,7 @@ ### Breaking Changes -- Minimum required version of `PowerShell Core` was raised from `6.0.2` to `6.1.0` due to `6.0` having reached the end of it's support life-cycle. (#1165) +- Minimum required version of `PowerShell Core` was raised from `6.0.2` to `6.1.0` due to `6.0` having reached the end of its support life-cycle. (#1165) - Updated used version of `Newtonsoft.Json` to `11.0.2`. (#1165) (by @bergmeister) - Command data files of PowerShell `6.0.2` were removed. Updated files for PowerShell `6.1.0` were added. This means that users that have customized the `UseCompatibleCmdlets` rule, need to either adapt the version string as per rule documentation or can alternatively copy in the old command data files into the `Settings` installation folder (#1075) (by @bergmeister) - The minimum required runtime of the full .Net Framework was raised from `4.5.1` to `4.5.2` as `4.5.1` is not supported any more. If the OS is patched then Windows update will have ensured that the newer runtime patch is available. (#1108) (by @bergmeister) From 00e5077e6e3287fd5c98a2b7713bce24e001415f Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Wed, 13 Mar 2019 20:10:14 +0000 Subject: [PATCH 4/7] Uodate PR description of bug with Invoke-Formatter to address PR feedback --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 997a68ff9..b56662b89 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -46,7 +46,7 @@ Multi-threading efficiency was highly improved leading to a speedup whilst keepi - Fix settings file array parsing when no commas are present (#1161) (by @rjmholt) - Ensure correct disposal with using statement (#1164) (by @bergmeister) - Emit parsing errors as diagnostic records (#1130) (by @JamesWTruher) -- Make Invoke-Formatter cleanup its state in the same way as Invoke-ScriptAnalyzer does to avoid knock on effect on Invoke-ScriptAnalyzer when Invoke-Formatter is being called (#1121) (by @bergmeister) +- Fix bug that caused Invoke-ScriptAnalyzer to not run any rule after an execution of Invoke-Formatter in the same session (but Invoke-ScriptAnalyzer would've recovered when being called again) (#1121) (by @bergmeister) - Fix parsing of empty hashtable when string is provided as settings object (#1073) (by @bergmeister) - Fix AlignAssignment rule to calculate alignment position correctly and avoid crash (#1070) (by @bergmeister) - Don't crash on CIM classes with no superclass (#1046) (Thanks @edyoung!) From 15592b31951aa73dfecd129ed30c5432c1748786 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Thu, 14 Mar 2019 20:36:02 +0000 Subject: [PATCH 5/7] address pr comment about breaking change --- CHANGELOG.MD | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index b56662b89..9704d25cd 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -8,6 +8,7 @@ - Updated used version of `Newtonsoft.Json` to `11.0.2`. (#1165) (by @bergmeister) - Command data files of PowerShell `6.0.2` were removed. Updated files for PowerShell `6.1.0` were added. This means that users that have customized the `UseCompatibleCmdlets` rule, need to either adapt the version string as per rule documentation or can alternatively copy in the old command data files into the `Settings` installation folder (#1075) (by @bergmeister) - The minimum required runtime of the full .Net Framework was raised from `4.5.1` to `4.5.2` as `4.5.1` is not supported any more. If the OS is patched then Windows update will have ensured that the newer runtime patch is available. (#1108) (by @bergmeister) +- Emit parsing errors as diagnostic records (#1130) (by @JamesWTruher) ### Formatter Rules @@ -45,7 +46,6 @@ Multi-threading efficiency was highly improved leading to a speedup whilst keepi - Fix bug when culture was set to Turkish (#1095) (by @bergmeister) - Fix settings file array parsing when no commas are present (#1161) (by @rjmholt) - Ensure correct disposal with using statement (#1164) (by @bergmeister) -- Emit parsing errors as diagnostic records (#1130) (by @JamesWTruher) - Fix bug that caused Invoke-ScriptAnalyzer to not run any rule after an execution of Invoke-Formatter in the same session (but Invoke-ScriptAnalyzer would've recovered when being called again) (#1121) (by @bergmeister) - Fix parsing of empty hashtable when string is provided as settings object (#1073) (by @bergmeister) - Fix AlignAssignment rule to calculate alignment position correctly and avoid crash (#1070) (by @bergmeister) @@ -88,8 +88,8 @@ Multi-threading efficiency was highly improved leading to a speedup whilst keepi - Update PR template to be more similar to the one of PowerShell but still distinguish where necessary (#1077) - Update documentation of `PSUseConsistentWhiteSpace`: enhance example and correct argument type. #1069 (Thanks @TheIncorrigible1!) - Update AvoidNullOrEmptyHelpMessageAttribute.md fix typo (#1068) (Thanks @TheIncorrigible1!) - - ## [1.17.1](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.17.1) - 2018-06-06 + +## [1.17.1](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.17.1) - 2018-06-06 ### Fixes From cd1f1b25756782cef42d45c10f07a7dd77d93d20 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Fri, 15 Mar 2019 08:32:30 +0000 Subject: [PATCH 6/7] Apply suggestions from code review --- CHANGELOG.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 9704d25cd..2fb927d8e 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -6,7 +6,7 @@ - Minimum required version of `PowerShell Core` was raised from `6.0.2` to `6.1.0` due to `6.0` having reached the end of its support life-cycle. (#1165) - Updated used version of `Newtonsoft.Json` to `11.0.2`. (#1165) (by @bergmeister) -- Command data files of PowerShell `6.0.2` were removed. Updated files for PowerShell `6.1.0` were added. This means that users that have customized the `UseCompatibleCmdlets` rule, need to either adapt the version string as per rule documentation or can alternatively copy in the old command data files into the `Settings` installation folder (#1075) (by @bergmeister) +- Command data files of PowerShell `6.0` were removed. Updated files for PowerShell `6.1` were added. This means that users that have customized the `UseCompatibleCmdlets` rule, need to either adapt the version string as per rule documentation or can alternatively copy in the old command data files into the `Settings` installation folder (#1075) (by @bergmeister) - The minimum required runtime of the full .Net Framework was raised from `4.5.1` to `4.5.2` as `4.5.1` is not supported any more. If the OS is patched then Windows update will have ensured that the newer runtime patch is available. (#1108) (by @bergmeister) - Emit parsing errors as diagnostic records (#1130) (by @JamesWTruher) From a7ce6b3fbf253343608c33fe37f2444bc60c86a1 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Fri, 15 Mar 2019 23:10:32 +0000 Subject: [PATCH 7/7] Update with recently merged PRs --- CHANGELOG.MD | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 2fb927d8e..f504f201b 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -20,7 +20,7 @@ - Add command data file for PowerShell `2.0` (#1091) (by @bergmeister) - Add command data files of PowerShell `6.1.0` (#1075) (by @bergmeister) -- New PowerShell compatibility rules: `UseCompatibleCommands`, `UseCompatibleSyntax` and `UseCompatibleTypes` (#1156 and #1133) (by @rjmholt) +- New PowerShell compatibility rules: `UseCompatibleCommands`, `UseCompatibleSyntax` and `UseCompatibleTypes` (#1156, #1133 and #1176) (by @rjmholt and @JamesWTruher) - Make `PossibleIncorrectComparisonWithNull` rule return a `SuggestCorrection` for auto-fixes in VS-Code or via the -Fix switch (#1115) (by @bergmeister) - Make UseCompatibleCmdlets not throw if default reference desktop-5.1.14393.206-windows is specified in the list of platforms and use core-6.1.0-windows as an alternative default reference (#1043 and #1075) (by @bergmeister) @@ -50,13 +50,14 @@ Multi-threading efficiency was highly improved leading to a speedup whilst keepi - Fix parsing of empty hashtable when string is provided as settings object (#1073) (by @bergmeister) - Fix AlignAssignment rule to calculate alignment position correctly and avoid crash (#1070) (by @bergmeister) - Don't crash on CIM classes with no superclass (#1046) (Thanks @edyoung!) -- Trigger AvoidPositionalParameters rule for function defined and called inside a script. (#963) (Thanks @kalgiz!) +- Trigger AvoidPositionalParameters rule for function defined and called inside a script. (#963 and #1175) (Thanks @kalgiz! and @bergmeister) - Add OutputType attributes to cmdlets to enhance tab completion (#1020) (by @bergmeister) - Allow paths to be pipelined to Invoke-ScriptAnalyzer (#1040) (Thanks @edyoung!) - PSGallery will no longer use PSAvoidUsingConvertToSecureStringWithPlainText and PSAvoidUsingUserNameAndPasswordParams rules (#1037) (Thanks @edyoung!) ### Build +- Update platyps to 0.13 (#1172) (by @bergmeister) - Raise minimum required PS version of PS 6 to `6.1.0` due to 6.0 running out of support now and update Newtonsoft.Json to `11.0.2` (#1165) (by @bergmeister) - Unify reference to `Microsoft.Management.Infrastructure` and update `System.Reflection.TypeExtensions` NuGet package (#1105) (by @bergmeister) - Update .Net Core SDK from 2.2.103 to `2.2.104` (latest patch) (#1158) (by @bergmeister)