PowerShell / PSScriptAnalyzer

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

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

Closed i5513 closed 1 year ago

i5513 commented 1 year 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 1 year 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