René's URL Explorer Experiment


Title: Invoke-Formatter: indent a block even though it should not · Issue #1933 · PowerShell/PSScriptAnalyzer · GitHub

Open Graph Title: Invoke-Formatter: indent a block even though it should not · Issue #1933 · PowerShell/PSScriptAnalyzer

X Title: Invoke-Formatter: indent a block even though it should not · Issue #1933 · PowerShell/PSScriptAnalyzer

Description: Before submitting a bug report: issue is similar, but not exactly, like #1315, so I'm opening a different issue. Note: this has nothing to do with VSCode, only the Invoke-Formatter cmdlet. Steps to reproduce Save the following file as te...

Open Graph Description: Before submitting a bug report: issue is similar, but not exactly, like #1315, so I'm opening a different issue. Note: this has nothing to do with VSCode, only the Invoke-Formatter cmdlet. Steps to...

X Description: Before submitting a bug report: issue is similar, but not exactly, like #1315, so I'm opening a different issue. Note: this has nothing to do with VSCode, only the Invoke-Formatter cmdlet. Step...

Opengraph URL: https://github.com/PowerShell/PSScriptAnalyzer/issues/1933

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Invoke-Formatter: indent a block even though it should not","articleBody":"Before submitting a bug report:\r\n\r\n- issue is similar, but not exactly, like #1315, so I'm opening a different issue.\r\n\r\nNote:  this has nothing to do with VSCode, only the `Invoke-Formatter` cmdlet.\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\nSave the following file as `test.ps1`:\r\n\r\n```PowerShell\r\n$PSStyle.OutputRendering = [System.Management.Automation.OutputRendering]::PlainText;\r\n\r\n$knownProperties = @()\r\nGet-ChildItem -Path . -Recurse -Filter pom.xml | ForEach-Object {\r\n    [xml]$pom = Get-Content $_\r\n    $knownProperties += $pom.project.properties.getEnumerator() |\r\n        Where-Object name -NE '#comment' |\r\n        ForEach-Object name\r\n    }\r\n\r\nGet-ChildItem -Path . -Recurse -Filter property-*-report.xml | ForEach-Object {\r\n    [xml]$report = Get-Content $_\r\n    $report.PropertyUpdatesReport.properties.property |\r\n        Where-Object { $_.lastVersion -NE $null -and $_.propertyName -in $knownProperties }\r\n\r\n    } | Select-Object propertyName, lastVersion | Sort-Object propertyName -Unique\r\n```\r\n\r\nThen, run the formatter:\r\n\r\n```PowerShell\r\nInvoke-Formatter -ScriptDefinition (Get-Content -Raw -Path ./test.ps1)\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n```PowerShell\r\n$PSStyle.OutputRendering = [System.Management.Automation.OutputRendering]::PlainText;\r\n\r\n$knownProperties = @()\r\nGet-ChildItem -Path . -Recurse -Filter pom.xml | ForEach-Object {\r\n    [xml]$pom = Get-Content $_\r\n    $knownProperties += $pom.project.properties.getEnumerator() |\r\n        Where-Object name -NE '#comment' |\r\n        ForEach-Object name\r\n    }\r\n\r\nGet-ChildItem -Path . -Recurse -Filter property-*-report.xml | ForEach-Object {\r\n    [xml]$report = Get-Content $_\r\n    $report.PropertyUpdatesReport.properties.property |\r\n        Where-Object { $_.lastVersion -NE $null -and $_.propertyName -in $knownProperties }\r\n\r\n    } | Select-Object propertyName, lastVersion | Sort-Object propertyName -Unique\r\n```\r\n\r\nActual behavior\r\n---------------\r\n\r\nThe second line starting with `Get-ChildItem` gets indented and all its pipeline, for no apparent reason:\r\n\r\n```PowerShell\r\n$PSStyle.OutputRendering = [System.Management.Automation.OutputRendering]::PlainText;\r\n\r\n$knownProperties = @()\r\nGet-ChildItem -Path . -Recurse -Filter pom.xml | ForEach-Object {\r\n    [xml]$pom = Get-Content $_\r\n    $knownProperties += $pom.project.properties.getEnumerator() |\r\n        Where-Object name -NE '#comment' |\r\n        ForEach-Object name\r\n    }\r\n\r\n    Get-ChildItem -Path . -Recurse -Filter property-*-report.xml | ForEach-Object {\r\n        [xml]$report = Get-Content $_\r\n        $report.PropertyUpdatesReport.properties.property |\r\n            Where-Object { $_.lastVersion -NE $null -and $_.propertyName -in $knownProperties }\r\n\r\n        } | Select-Object propertyName, lastVersion | Sort-Object propertyName -Unique\r\n\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```PowerShell\r\n> $PSVersionTable\r\nName                           Value\r\n----                           -----\r\nPSVersion                      7.3.6\r\nPSEdition                      Core\r\nGitCommitId                    7.3.6\r\nOS                             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\r\nPlatform                       Unix\r\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion      2.3\r\nSerializationVersion           1.1.0.1\r\nWSManStackVersion              3.0\r\n\r\n> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }\r\n1.21.0\r\n```\r\n","author":{"url":"https://github.com/Jiehong","@type":"Person","name":"Jiehong"},"datePublished":"2023-08-18T11:38:00Z","url":"https://github.com/PowerShell/PSScriptAnalyzer/issues/1933"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:28dc2984-cd10-94f5-f77d-c1d604804663
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBE8E:232E56:222B8B:2D6421:6AFCE087
html-safe-nonce0b4f982c2b3f40df144f2575650c1e28550e8a48f490f8b728a09e1c38c927ae
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRThFOjIzMkU1NjoyMjJCOEI6MkQ2NDIxOjZBRkNFMDg3IiwidmlzaXRvcl9pZCI6IjkwOTUzMjA3OTI3NjUwOTYwNzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca28d9a3fc6f39be318b1e8c90b0e6a3be8ee8e9cdf1264f5c2666629aa859296
hovercard-subject-tagissue:1856574456
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PSScriptAnalyzer/1933/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b89beab20380553a41e9da7cb06af90ca6b9a03738004e04cc4a9136fd64f11a/PowerShell/PSScriptAnalyzer/issues/1933
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b89beab20380553a41e9da7cb06af90ca6b9a03738004e04cc4a9136fd64f11a/PowerShell/PSScriptAnalyzer/issues/1933
og:image:altBefore submitting a bug report: issue is similar, but not exactly, like #1315, so I'm opening a different issue. Note: this has nothing to do with VSCode, only the Invoke-Formatter cmdlet. Steps to...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJiehong
hostnamegithub.com
expected-hostnamegithub.com
None99aede4c5f55ec5cf06666a8c9e03ebf9f85f7231223e7f1c38c16e5504835b3
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PSScriptAnalyzer git https://github.com/PowerShell/PSScriptAnalyzer.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id33149177
octolytics-dimension-repository_nwoPowerShell/PSScriptAnalyzer
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id33149177
octolytics-dimension-repository_network_root_nwoPowerShell/PSScriptAnalyzer
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseecfd63ca125ec74b42f74eeb158b3fa081c8c497
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PSScriptAnalyzer/issues/1933#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPSScriptAnalyzer%2Fissues%2F1933
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPSScriptAnalyzer%2Fissues%2F1933
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPSScriptAnalyzer
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/issues/1933
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/issues/1933
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/issues/1933
PowerShellhttps://github.com/PowerShell
PSScriptAnalyzerhttps://github.com/PowerShell/PSScriptAnalyzer
Codehttps://github.com/PowerShell/PSScriptAnalyzer
Issues407 (407)https://github.com/PowerShell/PSScriptAnalyzer/issues
Pull requests34 (34)https://github.com/PowerShell/PSScriptAnalyzer/pulls
Discussionshttps://github.com/PowerShell/PSScriptAnalyzer/discussions
Actionshttps://github.com/PowerShell/PSScriptAnalyzer/actions
Projectshttps://github.com/PowerShell/PSScriptAnalyzer/projects
Wikihttps://github.com/PowerShell/PSScriptAnalyzer/wiki
Security and qualityhttps://github.com/PowerShell/PSScriptAnalyzer/security
Insightshttps://github.com/PowerShell/PSScriptAnalyzer/insights
https://github.com/PowerShell/PSScriptAnalyzer
#2173https://github.com/PowerShell/PSScriptAnalyzer/pull/2173
Invoke-Formatter: indent a block even though it should nothttps://github.com/PowerShell/PSScriptAnalyzer/issues/1933#top
#2173https://github.com/PowerShell/PSScriptAnalyzer/pull/2173
Area - Formatterhttps://github.com/PowerShell/PSScriptAnalyzer/issues?q=state%3Aopen%20label%3A%22Area%20-%20Formatter%22
Issue - Bughttps://github.com/PowerShell/PSScriptAnalyzer/issues?q=state%3Aopen%20label%3A%22Issue%20-%20Bug%22
https://github.com/Jiehong
Jiehong (Jiehong)https://github.com/Jiehong
on Aug 18, 2023https://github.com/PowerShell/PSScriptAnalyzer/issues/1933#issue-1856574456
Format indention of multiline statements #1315https://github.com/PowerShell/PSScriptAnalyzer/issues/1315
https://github.com/JamesWTruher
James Truher (JamesWTruher)https://github.com/JamesWTruher
on Aug 29, 2023https://github.com/PowerShell/PSScriptAnalyzer/issues/1933#issuecomment-1698221973
Christoph Bergmeister (@bergmeister)https://github.com/bergmeister
https://github.com/ThubLives
ThubLiveshttps://github.com/ThubLives
on Mar 9, 2026https://github.com/PowerShell/PSScriptAnalyzer/issues/1933#issuecomment-4025211962
Christoph Bergmeister (bergmeister)https://github.com/bergmeister
Area - Formatterhttps://github.com/PowerShell/PSScriptAnalyzer/issues?q=state%3Aopen%20label%3A%22Area%20-%20Formatter%22
Issue - Bughttps://github.com/PowerShell/PSScriptAnalyzer/issues?q=state%3Aopen%20label%3A%22Issue%20-%20Bug%22
on Mar 31, 2026https://github.com/PowerShell/PSScriptAnalyzer/issues/1933#event-24087316697
https://github.com/bergmeister
Christoph Bergmeister (bergmeister)https://github.com/bergmeister
on Mar 31, 2026https://github.com/PowerShell/PSScriptAnalyzer/issues/1933#issuecomment-4165083070
Liam Peters (@liamjpeters)https://github.com/liamjpeters
https://github.com/liamjpeters
Liam Peters (liamjpeters)https://github.com/liamjpeters
on Apr 1, 2026https://github.com/PowerShell/PSScriptAnalyzer/issues/1933#issuecomment-4170132299
Christoph Bergmeister (@bergmeister)https://github.com/bergmeister
https://github.com/liamjpeters
Liam Peters (liamjpeters)https://github.com/liamjpeters
on Apr 2, 2026https://github.com/PowerShell/PSScriptAnalyzer/issues/1933#issuecomment-4175375533
https://github.com/bergmeister
Christoph Bergmeister (bergmeister)https://github.com/bergmeister
on Apr 2, 2026https://github.com/PowerShell/PSScriptAnalyzer/issues/1933#issuecomment-4176301609
Liam Peters (liamjpeters)https://github.com/liamjpeters
on Apr 3, 2026https://github.com/PowerShell/PSScriptAnalyzer/issues/1933#event-24173304329
Merge branch 'main' into PowerShell#1933-PipelineIndentationIssuehttps://github.com/liamjpeters/PSScriptAnalyzer/commit/2af0dae478945d7f5749be7c17fce7b2b12e1269
PowerShell#1933https://github.com/PowerShell/PSScriptAnalyzer/issues/1933
2af0daehttps://github.com/liamjpeters/PSScriptAnalyzer/commit/2af0dae478945d7f5749be7c17fce7b2b12e1269
Liam Peters (liamjpeters)https://github.com/liamjpeters
on Apr 15, 2026https://github.com/PowerShell/PSScriptAnalyzer/issues/1933#event-24536341359
Merge branch 'PowerShell#1933-PipelineIndentationIssue' of https://gi…https://github.com/liamjpeters/PSScriptAnalyzer/commit/b470da8f40e3a8d965cea117a14011993c53fd73
PowerShell#1933https://github.com/PowerShell/PSScriptAnalyzer/issues/1933
https://gi…https://github.com/liamjpeters/PSScriptAnalyzer
b470da8https://github.com/liamjpeters/PSScriptAnalyzer/commit/b470da8f40e3a8d965cea117a14011993c53fd73
Andy Jordan (andyleejordan)https://github.com/andyleejordan
completedhttps://github.com/PowerShell/PSScriptAnalyzer/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#2173https://github.com/PowerShell/PSScriptAnalyzer/pull/2173
on May 4, 2026https://github.com/PowerShell/PSScriptAnalyzer/issues/1933#event-25149269451
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PSScriptAnalyzer/issues/1933
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PSScriptAnalyzer/issues/1933
Area - Formatterhttps://github.com/PowerShell/PSScriptAnalyzer/issues?q=state%3Aopen%20label%3A%22Area%20-%20Formatter%22
Issue - Bughttps://github.com/PowerShell/PSScriptAnalyzer/issues?q=state%3Aopen%20label%3A%22Issue%20-%20Bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.