PSScriptAnalyzer
PSScriptAnalyzer copied to clipboard
Download ScriptAnalyzer from PowerShellGallery
**Summary of the new feature** Enhance formatting of continued (multiline) statements (command and expression), combining the PipeLineIndentionStyle with statement continuation. There are a lot of means to continue command statements,...
Just a heads up: In the (near?) future, dictionary keys are going to support the `IList` interface. This would mean that e.g. `@($Dictionary.Keys)[0]` can be simplified to `$Dictionary.Keys[0]`. see: [`#15843`...
This is just a spitball idea to contribute feedback if it is maybe feasible, I might consider attempting a PR # Problem Often when writing a pipeline you may pipe...
Steps to reproduce ------------------ Run PSSA against the following code: ```PowerShell function Test-FormatLimitGlobal { # Change format enum limit Globally $Old = $Global:FormatEnumerationLimit $Global:FormatEnumerationLimit = 1 "After changing: [$Global:FormatEnumerationLimit]" Get-Process...
Using the `Fix` option for the `PSAvoidTrailingWhitespace` rule is broken. Steps to reproduce ------------------ I have installed PSScriptAnalyzer v1.20.0 using chocolatey and run the following command in this folder: https://github.com/mandiant/VM-Packages/tree/2726fcde4bba996dcd446b240c3439a129ddba7d/packages...
**Summary of the new feature** Consider the following ``` $List | Where-Object { } | ForEach-Object { } ``` This is a formatted piece of PowerShell with the notable feature...
### System Details **Manjaro Linux:** ``` ### VSCode version: 1.56.2 054a9295330880ed74ceaedda236253b4f39a335 x64 ### VSCode extensions: [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] ### PSES version: 2.3.0.0 ### PowerShell version: Name Value...
Steps to reproduce ------------------ Create a file with a fixable violation ```PowerShell Function Test-Function { param ( [String] $Password ) $Password } ``` Run `Invoke-ScriptAnalyzer -Path ./file.ps1 -Fix` to fix...
Bracketed Commandlet arguments spanning multiple lines should increase the indentation level. See `Invoke-Bar` in the below example. Expected behavior ----------------- ```PowerShell Invoke-Foo ` -Argument ( Invoke-Bar -Argument ) ` -Argument2...
Steps to reproduce ------------------ ```PowerShell $ErrorView = 'NormalView' ``` Expected behavior ----------------- No warning is issued for assignment without use of [any preference variable](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables). This is another variation of #651...