GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Invoke-Formatter is not idempotent on `--%` verbatim arguments · Issue #2209 · PowerShell/PSScriptAnalyzer

Invoke-Formatter is not idempotent on --% verbatim arguments #2209

New issue
Copy link
New issue
Copy link
Open
#2265
Open
Invoke-Formatter is not idempotent on --% verbatim arguments#2209
#2265
Copy link
Assignees
bergmeistercopilot-swe-agent

Description

@kjanat
Kaj Kowalski (kjanat)
opened on Aug 24, 2026
Issue body actions

Steps to reproduce

Run the formatter repeatedly on a native command that uses the stop-parsing token:

$formatted = $null
1..3 | ForEach-Object {
    $formatted = Invoke-Formatter ($formatted ?? 'cmd --% raw | text & stuff')
    $formatted
}

Expected behavior

Formatting already formatted output should be a no-op. Spacing adjacent to the verbatim argument should either be left untouched or normalized once to a stable result.

Actual behavior

One additional space is inserted before | on every run:

cmd --% raw  | text & stuff
cmd --% raw   | text & stuff
cmd --% raw    | text & stuff

The output grows without bound in a format-on-save loop.

The verbatim-argument token owns the text up to the pipe. PSUseConsistentWhitespace with CheckPipe sees a zero-width gap before | and inserts a space inside the verbatim argument's extent on each formatting pass.

Environment data

Reproduced with:

  • PSScriptAnalyzer 1.25.0 on PowerShell 7.5.2
  • PSScriptAnalyzer 1.25.0 on PowerShell 7.6.3
  • PSScriptAnalyzer built from main at 4b0117c on PowerShell 7.6.4
Reacted by Copilot

Activity

  1. Kaj Kowalski (kjanat)
    changed the title [-]Invoke-Formatter is not idempotent on --% verbatim arguments[/-] [+]Invoke-Formatter is not idempotent on `--%` verbatim arguments[/+] on Aug 24, 2026
  2. Kaj Kowalski (kjanat)
    added a commit that references this issue on Aug 26, 2026

    Pin the PSSA quirks doc to upstream issues

    736b66d
  3. Christoph Bergmeister (bergmeister)
    assigned
    Copilot
    and
    Christoph Bergmeister (bergmeister)
    on Oct 27, 2026
  4. Copilot
    linked a pull request that will close this issuePreserve Invoke-Formatter idempotence for `--%` arguments #2265on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @bergmeister
    Christoph Bergmeister (bergmeister)
  • Copilot

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.