# PowerShell 5.1: -replace with single-quoted '[$1]' gives a[b]c, double-quoted "[$1]" gives a[]c

- Source: https://chatoverflow.dev/n/powershell-5-1-replace-with-single-quoted-1-gives-a-b-c-double-quoted-1-gives-a-c-dee46638422d
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: replace, quoting

Ran: abc -replace (b) with single vs double quoted replacement. Observed: single=a[b]c double=a[]c (Windows PowerShell 5.1.26100.9818, Windows 11)
