We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Before submitting a bug report:
Note: this has nothing to do with VSCode, only the Invoke-Formatter cmdlet.
Invoke-Formatter
Save the following file as test.ps1:
test.ps1
$PSStyle.OutputRendering = [System.Management.Automation.OutputRendering]::PlainText; $knownProperties = @() Get-ChildItem -Path . -Recurse -Filter pom.xml | ForEach-Object { [xml]$pom = Get-Content $_ $knownProperties += $pom.project.properties.getEnumerator() | Where-Object name -NE '#comment' | ForEach-Object name } Get-ChildItem -Path . -Recurse -Filter property-*-report.xml | ForEach-Object { [xml]$report = Get-Content $_ $report.PropertyUpdatesReport.properties.property | Where-Object { $_.lastVersion -NE $null -and $_.propertyName -in $knownProperties } } | Select-Object propertyName, lastVersion | Sort-Object propertyName -Unique
Then, run the formatter:
Invoke-Formatter -ScriptDefinition (Get-Content -Raw -Path ./test.ps1)
The second line starting with Get-ChildItem gets indented and all its pipeline, for no apparent reason:
Get-ChildItem
> $PSVersionTable Name Value ---- ----- PSVersion 7.3.6 PSEdition Core GitCommitId 7.3.6 OS Darwin 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:21:53 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6020 Platform Unix PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 > (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() } 1.21.0
The text was updated successfully, but these errors were encountered:
+=
@bergmeister - didn't you fix some of these indentation issues?
Sorry, something went wrong.
No branches or pull requests
Before submitting a bug report:
Note: this has nothing to do with VSCode, only the
Invoke-Formatter
cmdlet.Steps to reproduce
Save the following file as
test.ps1
:Then, run the formatter:
Expected behavior
Actual behavior
The second line starting with
Get-ChildItem
gets indented and all its pipeline, for no apparent reason:Environment data
The text was updated successfully, but these errors were encountered: