PowerShell / PowerShell/PSScriptAnalyzer

Add `-Path` parameter to `Invoke-Formatter`

Open
#775 19 comments 22 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area - Formatter Issue - Enhancement
Dominant language
C#
Stars
2.2k
Forks
414
Avg merge
13h 1m
Merged PRs (30d)
2

Description

Invoke-Formatter takes only a ScriptDefinition parameter. The user should be able to point the cmdlet to a file for formatting. However, the following things need to be preserved when formatting a file:

  • file encoding
  • new line characters
  • indentation type {tab, space}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Invoke-Formatter cmdlet implementation and its existing ScriptDefinition handling. Trace how file content would be read and formatted, then verify that a -Path workflow preserves the file encoding, newline characters, and tab-versus-space indentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.