PowerShell / PowerShell/PSScriptAnalyzer
formatting unavailable inside interpolated subexpression
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
Formatting doesn't seem to occur for code contained within an interpolation:

In this example, the other 'else' statements just reformatted, but the remaining ones are inside an interpolation. It appears no formatting occurs in this condition, not even via using a selection (in VS Code). I use a lot of complicated interpolations. This code comes from https://github.com/msftrncs/PwshJSONtoPList/blob/master/ConvertTo-PList.ps1
> $PSVersionTable
Name Value
---- -----
PSVersion 6.2.0
PSEdition Core
GitCommitId 6.2.0
OS Microsoft Windows 10.0.18890
Platform Win32NT
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.18.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the formatting behavior from the PowerShell example in the issue, including a selection in VS Code, and inspect how interpolated subexpressions are handled by PSScriptAnalyzer's formatter. Done means code inside the interpolation is formatted consistently with the surrounding else statements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100