Skip to content

Commit 428f8b0

Browse files
David ReynoldsDavid Reynolds
authored andcommitted
Merge remote-tracking branch 'refs/remotes/PowerShell/development' into AvoidGlobalFunctions
2 parents 144acf2 + f5c5efb commit 428f8b0

File tree

52 files changed

+780
-228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+780
-228
lines changed

CHANGELOG.MD

Lines changed: 62 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
## Release v1.7.0
1+
## [1.8.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.8.0) - 2016-10-06
2+
### Added
3+
- New [rule](RuleDocumentation/UseCompatibleCmdlets.md) to check cmdlet compatibility between different PowerShell flavors
4+
- New [rule](RuleDocumentation/UseLiteralInitializerForHashtable.md) to warn when using Hashtable constructor
5+
- Feature to [pass parameters to rules from settings file](RuleDocumentation/AvoidAlias.md)
6+
- Feature to [discover settings file](README.md#settings-support-in-scriptanalyzer)
7+
- Enhancement to [PSShouldProcess](RuleDocumentation/UseShouldProcessCorrectly.md) rule to check for ShouldProcess implementation in downstream functions
8+
- A helper [module](Utils/RuleMaker.psm1) to create `C#` based builtin rules
9+
10+
### Fixed
11+
- False negatives for identically named variables (#552)
12+
- Passing `*Ast` arguments to external rules (#614)
13+
14+
### Changed
15+
- PSShouldProcess rule to not check for presence of `ShouldContinue` when `SupportsShouldProcess` is declared
16+
17+
## [1.7.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.7.0) - 2016-08-16
218

319
Here are some improvements since the last release.
420

@@ -9,18 +25,18 @@ Here are some improvements since the last release.
925
- Fix rule suppression caused by inavlid offsets
1026
- Whitelist `Data` in `PSUseSingularNoun` rule
1127
- Fix rule documentation of `PSDSCExamplesPresent`
12-
- Fix false positives caused by PSD1 files which are not module manifests
28+
- Fix false positives caused by PSD1 files which are not module manifests
1329
- affects `PSUseToExportFieldsInManifest`, `PSMissingModuleManifestField` and `PSAvoidUsingDeprecatedManifestFields` rules
1430
- Use PlatyPS for generating MAML based documentation
1531
- Add build script to automate building and testing the solution
16-
32+
1733
A big **Thank You!** to the following folks for making PSScriptAnalyzer even better:
1834
- [Kieran Jacobsen (@kjacobsen)](https://github.com/PowerShell/PSScriptAnalyzer/commits/development?author=kjacobsen): Fix rule documentation of `PSDSCExamplesPresent` [PR #591](https://github.com/PowerShell/PSScriptAnalyzer/pull/591)
1935
- [Charlie Schmidt (@charlieschmidt)](https://github.com/PowerShell/PSScriptAnalyzer/commits/development?author=charlieschmidt): Suppress External Rules [PR #585](https://github.com/PowerShell/PSScriptAnalyzer/pull/585)
2036
- [June Blender (@juneb)](https://github.com/PowerShell/PSScriptAnalyzer/commits/development?author=juneb): Add tests for module help [058f65e1](https://github.com/PowerShell/PSScriptAnalyzer/commit/058f65e1f6278222378fedf444eecb2e32865b1e)
2137
- [Shayde Nofziger (@Blackbaud-ShaydeNofziger)](https://github.com/PowerShell/PSScriptAnalyzer/commits/development?author=Blackbaud-ShaydeNofziger): Fix rule name typo and comment [PR #560](https://github.com/PowerShell/PSScriptAnalyzer/pull/560)
2238

23-
## Release v1.6.0
39+
## [1.6.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.6.0) - 2016-06-07
2440

2541
### Engine
2642
- Add `SuggestedCorrections` property to `DiagnosticRecord`
@@ -50,7 +66,7 @@ A big **Thank You!** to the following folks for making PSScriptAnalyzer even bet
5066
- Fix a bug in `PSMissingModuleManifestField` rule caused by .psd1 files that do not contain Hashtable
5167
- Fix documentation of `PSAvoidUsingPlainTextForPassword`
5268

53-
## Release v1.5.0 (Mar. 30, 2016)
69+
## [1.5.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.5.0) - 2016-03-29
5470

5571
### Engine
5672
- Fixed an engine bug that prevented versioned script rule modules from being loaded
@@ -67,57 +83,57 @@ A big **Thank You!** to the following folks for making PSScriptAnalyzer even bet
6783
- Community Fix: Fixed false positives on `PSUseApprovedVerbs` when scope is declared as a prefix to the Verb-Noun combination
6884
- Updated messages of `AvoidUsernameAndPasswordParams` rule and `UsePSCredentialType` rule
6985

70-
## Release v1.4.0 (Feb.16, 2016)
71-
###Features:
86+
## [1.4.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.4.0) - 2016-02-16
87+
### Features:
7288
- IncludeRule and ExcludeRule now consume RuleInfo objects
7389

74-
###Rules:
90+
### Rules:
7591
- Rule to validate HelpMessage parameter attribute value
7692
- Rule to suggest module manifest *ToExport field values for optimizing module loading
7793

78-
###Fixes:
79-
####Engine:
94+
### Fixes:
95+
#### Engine:
8096
- Fixed bug in engine handling of severity for custom rules - this property was being ignored
8197
- Exclude help files from being Ast parsed
8298

83-
####Rules:
99+
#### Rules:
84100
- Emit accurate ast extents for rules - helps VSCode-PowerShell to mark violations better
85101
- Improved heuristics for Singular noun rule - reduce false positives
86102
- Updated credential rules to be less noisy based on community feedback
87103
- Support for [switch] type along with [boolean] for ShouldContinueWithoutForce rule
88104
- Improved handling of deprecated module manifest fields when PSv2.0 is specified in the manifest
89105

90-
## Release v1.3.0 (Jan.19, 2016)
91-
###Features:
106+
## [1.3.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.3.0) - 2016-01-19
107+
### Features:
92108
- Support for running ScriptAnalyzer on PowerShell version v3 or higher! This means PSv5 is no longer the minimum PS version for ScriptAnalyzer
93109

94-
###Rules:
110+
### Rules:
95111
- [From Community] Rule for warning about backticks that look like line-continuations but are not [MisleadingBacktick rule]
96112
- Ability in default ruleset to recognize PowerShell variable scopes - global, local, script, private
97113
- Ability to use functions as a variable and support for special type of functions like prompt
98114

99-
###Fixes:
100-
####Rules:
115+
### Fixes:
116+
#### Rules:
101117
- Fix for recognizing PowerShell preference variable ($OFS) in the default ruleset
102118
- Fix for false positive - PSShouldProcess rule requires boolean value
103119
- Fix to account for function scope prefix
104120
- Raise ReservedParam rule only for exported functions as cmdlets
105121

106-
## Release v1.2.0 (Dec.17, 2015)
107-
###Features:
122+
## [1.2.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.2.0) - 2015-12-16
123+
### Features:
108124
- Support for consuming PowerShell content as streams (-ScriptDefinition)
109125
- ScriptAnalyzer accepts configuration (settings) in the form of a hashtable (-Settings), added sample Settings
110126
- Ability to run default ruleset along with custom ones in the same invocation (-IncludeDefaultRules)
111127
- Recurse Custom Rule Paths (-RecurseCustomRulePath)
112128
- Consistent Engine error handling when working with Settings, Default and Custom Rules
113129

114-
###Rules:
130+
### Rules:
115131
- Rule to detect the presence of default value for Mandatory parameters (AvoidDefaultValueForMandatoryParameter)
116132

117-
###Fixes:
118-
####Engine:
133+
### Fixes:
134+
#### Engine:
119135
- Engine update to prevent script based injection attacks
120-
- CustomizedRulePath is now called CustomRulePath Fixes to handle folder paths
136+
- CustomizedRulePath is now called CustomRulePath – Fixes to handle folder paths
121137
- Fixes for RecurseCustomRulePath functionality
122138
- Fix to binplace cmdlet help file as part of build process
123139
- ScriptAnalyzer Profile is now called Settings
@@ -126,69 +142,59 @@ A big **Thank You!** to the following folks for making PSScriptAnalyzer even bet
126142
- Added additional pester tests to take care of test holes in Custom Rule feature
127143
- Post-build error handling improvements, fixed typos in the project
128144

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

137-
###Documentation:
138-
- Rule & Cmdlet documentation updates – Cmdlet help file addition
139-
153+
### Documentation:
154+
- Rule & Cmdlet documentation updates – Cmdlet help file addition
140155

141-
##
142-
143-
## Release v1.1.1 (Nov.3, 2015)
144-
###Features:
156+
## [1.1.1](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.1.1) - 2015-11-03
157+
### Features:
145158
- Support for PSDrives when using Invoke-ScriptAnalyzer
146159
- More robust Profiles feature - better defaulting when supplied with invalid profile - actionable Warnings
147160
- Validated integration with ISESteroids, ISEScriptAnalyzerAddon
148161

149-
###Rules:
162+
### Rules:
150163
- New rule to ensure that a file with missing BOM is encoded in ASCII
151164

152-
###Fixes:
165+
### Fixes:
153166
- Doc Updates, Cleaned up source files to reflect accurate comments
154167
- Fix SuppressedOnly switch functionality
155168
- Updated Positional parameter rule to trigger only when used with > 3 positional parameters
156169

157-
##
158-
159-
## Release v1.1.0 (Sep.1, 2015)
160-
###Features:
170+
## [1.1.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.1.0) - 2015-09-01
171+
### Features:
161172
- Support for using ScriptAnalyzer as a .net library - ScriptAnalyzer APIs
162173
- Support for ScriptAnalyzer Profiles
163174
- Documentation for using Inline Rule Suppression
164175
- Added about help topic file as part of the module
165176

166-
###Rules:
177+
### Rules:
167178
- Rule to checks for UTF8 encoding in help file
168179
- Deprecate Uninitialized Variable rule as per community feedback
169180

170-
171-
###Fixes:
181+
### Fixes:
172182
- Fix false positive for UsingInternalURL
173183
- WriteVerbose only when analyzing valid powershell files
174184
- DSCClass rules not being applied when exclude rule is used
175185
- Add host to list of initialized variable
176186
- Exclude external non-powershell applications (Console/GUI) from Positional Parameter rule application
177187
- Additional heuristics for detecting psavoidusingplaintextforpassword rule violation
178188

179-
##
180-
181-
## Release v1.0.2 (June.24, 2015)
182-
###Features:
189+
## [1.0.2](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.0.2) - 2015-06-24
190+
### Features:
183191
- Perf improvements in the Engine to execute rules concurrently.
184192

185-
186-
###Rules:
193+
### Rules:
187194
- New rule to validate the presence of deprecated module manifest fields.
188-
- Removed PSAvoidTrapStatement rule from the builtin set – since this is not deprecated and using trap is a better choice in certain scenarios.
189-
195+
- Removed PSAvoidTrapStatement rule from the builtin set – since this is not deprecated and using trap is a better choice in certain scenarios.
190196

191-
###Fixes:
197+
### Fixes:
192198
- Verbose Message rule applies to only DSC cmdlet based resources.
193199
- Multiple fixes to AvoidUninitializedVariable to work with non-mandatory parameters, fix in the flow graphs for throw statements; support for missing preference variables; support for automatic variables.
194200
- PSAvoidUsingInternalsURLs to work with xPath expressions.
@@ -204,36 +210,30 @@ A big **Thank You!** to the following folks for making PSScriptAnalyzer even bet
204210
- AvoidUsingPlainTextForPassword rule to be raised only strings or object types.
205211
- Fix for PositionalParameterUsed method (Helper.cs) uses unsafe method to exclude ForEach-Object and Where-Object.
206212

207-
##
208-
209-
## Release v1.0.1 (May.8, 2015)
210-
###Features:
213+
## [1.0.1](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.0.1) - 2015-05-12
214+
### Features:
211215
- Integrated with waffle.io for Project Management.
212216
- Added documentation for writing script rules.
213217

214-
###Rules:
218+
### Rules:
215219
- AvoidUsingWMICmdlet rule: For PowerShell 3.0 and above, usage of WMI cmdlets is not recommended. This rule is to detect WMI cmdlet usage in scripts that are written for PS 3.0 and above.
216220
- DSCTestsPresent rule: Resource module contains Tests folder with tests for given resource.
217221
- UseOutputTypeCorrectly rule: If we can identify the type of an object that is outputted to the pipeline by a cmdlet, then that type must be listed in the OutputType attribute.
218222

219-
###Fixes:
220-
223+
### Fixes:
221224
- PSProvideVerboseMessage only throws warnings in non-advanced functions.
222225
- Fix the issue in importing customized rule
223226
- Fix Function Member Ast cast error
224227

225-
##
226-
227-
##Released v1.0.0 on Apr.24, 2015
228-
###Features:
228+
## [1.0.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.0.0) - (2015/04/24)
229+
### Features:
229230
- Finalized three levels of Severity - Error/Warning/Information.
230231
- Improved PSScriptAnalyzer engine behavior: emits non-terminating errors (Ex: for failed ast parse) and continues rule application when running on multiple scripts.
231232
- Added wild card supports for rules in Invoke-ScriptAnalyzer and Get-ScriptAnalyzer. Eg. Invoke-ScriptAnalyzer -IncludeRule PSAvoid* will apply all rules starting with PSAvoid* in built in rule assemblies.
232233
- Added -Severity to Get-ScriptAnalyzerRules. Get-ScriptAnalyzer -Severity will filter rules based on the severity given.
233234
- Added Suppression functionality. Users are now able to specify suppression on certain parts of the scripts by specifying "SupressMessageAttribute" in the scripts. More details and documentations will be coming soon in blog posts. Also comes with this feature is the ability for users to display a list of suppressed messages.
234235

235-
###Rules:
236-
236+
### Rules:
237237
- Added DSC Rules for resources including Parameter validation, Usage of standard DSC functions and return type validation. Rule checkings also support for DSC classes. Built-in DSC rules include:
238238
+ UseStandardDSCFunctionsInResource
239239
+ UseIdenticalParametersDSC
@@ -242,12 +242,9 @@ A big **Thank You!** to the following folks for making PSScriptAnalyzer even bet
242242
- Added support in the engine to detect DSC configuration/resource files and disable default rule checkings on DSC configuration and resource files.
243243
- UseShouldProcessForStateChangingFunctions - If an advanced function has Verbs like New/Start/Stop/Restart/Reset/Set- that will change system state, it should support ShouldProcess attribute.
244244

245-
246-
###Fixes:
247-
245+
### Fixes:
248246
- Improved heuristics to detect usage of Username and Password instead of PSCredential type.
249247
- Improved accuracy in the detection of uninitialized variables.
250248
- Improved error messages to include error line numbers and file names.
251249
- Identified usage of PSBound parameters and PowerShell supplied variables such as $MyInvocation to avoid unnecessary noise in the results returned by some of the built-in rules.
252250
- Fixed terminating errors including "Illegal characters in Path".
253-

0 commit comments

Comments
 (0)