You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@BalassaMarton even in that case I would strongly recommend splatting as you can have conditional parameters, and overall make the invocation much more structured than using backticks with parameters.
Looks to me like the issue is at the PSScriptAnalyzer level, as shown here:
gmo psscriptanalyzer
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 1.22.0 psscriptanalyzer {Get-ScriptAnalyzerRule, Invoke-Formatter, Invoke…
So you will need to open the issue in scriptanalyzer and, when fixed and version released, will work its way to this repo to be fixed (you could also install an early release of psscriptanalyzer and the extension can use that)
EDIT: Sorry I initially misread the scriptanalyzer result
EDIT2: Nope, I did in fact read it correctly.
Prerequisites
Summary
Formatting multi-line function calls with hashtable parameters produces incorrect indentation of the function call.
Example script:
After formatting, the script looks like this:
Notice how the indentation of the function call is off after the
-ParameterObject
argument.PowerShell Version
Visual Studio Code Version
Extension Version
ms-vscode.powershell@2024.3.1
Steps to Reproduce
.ps1
extensionFormat Document
command (Shift+Alt+F
)Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: