If you try to do a -replace with a string that has two or more dollar signs next to it, one dollar sign gets removed. This happens even if the characters are escaped.
Steps to reproduce
Scenario 1: Two Dollar Signs in String Literal

Scenario 2: More Than Two Dollar Signs in String Literal

Scenario 3: One Dollar Sign in String Literal

Scenario 4: Two Dollar Signs in String Literal (escaped)

Expected behavior
Scenario 1: P@$$w0rd
Scenario 2: P@$$$w0rd
Scenario 3: P@$w0rd
Scenario 3: P@$$w0rd
Actual behavior
Scenario 1:

Scenario 2:

Scenario 3:

Scenario 4:

Environment data
$PSVersionTable

If you try to do a -replace with a string that has two or more dollar signs next to it, one dollar sign gets removed. This happens even if the characters are escaped.
Steps to reproduce
Scenario 1: Two Dollar Signs in String Literal

Scenario 2: More Than Two Dollar Signs in String Literal

Scenario 3: One Dollar Sign in String Literal

Scenario 4: Two Dollar Signs in String Literal (escaped)

Expected behavior
Scenario 1: P@$$w0rd
Scenario 2: P@$$$w0rd
Scenario 3: P@$w0rd
Scenario 3: P@
$$w0rdActual behavior
Scenario 1:

Scenario 2:

Scenario 3:

Scenario 4:

Environment data