PowerShell / PowerShell/PSScriptAnalyzer
formatting unavailable inside interpolated subexpression
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 2.2k
- Forks
- 414
- Ø Merge
- 13 Std. 1 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Formatierungsverhalten aus dem PowerShell-Beispiel im Issue zu reproduzieren, einschließlich einer Auswahl in VS Code, und untersuche, wie interpolierte Teilausdrücke vom Formatter von PSScriptAnalyzer behandelt werden. Erledigt ist es, wenn der Code innerhalb der Interpolation konsistent mit den umgebenden else-Anweisungen formatiert wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100