PowerShell / PSScriptAnalyzer

Download ScriptAnalyzer from PowerShellGallery
https://www.powershellgallery.com/packages/PSScriptAnalyzer/
MIT License
1.8k stars 365 forks source link

Make sentences if/else/elseif and try/catch/finally format configurable #1941

Closed i5513 closed 9 months ago

i5513 commented 9 months ago

Currently psscriptanalyzer uses this format:

try {
    xxx
}
catch {
    yyyy
}

I understand this is a clear way to write the sentence, but I would prefer:

try {
    xxx
} catch {
   yyyy
}

Is there a configuration option for this ?

Thank you!

i5513 commented 9 months ago

I'm sorry I did not did a good search, a partner said me about a configuration option

Solved by reading https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/rules/placeclosebrace?view=ps-modules