Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Dollar Sign Gets 'Eaten' by -replace When More Than One Dollar Sign Adjacent In String #6842

Copy link
Copy link
@blixthecat

Description

@blixthecat
Issue body actions

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
image

Scenario 2: More Than Two Dollar Signs in String Literal
image

Scenario 3: One Dollar Sign in String Literal
image

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

Expected behavior

Scenario 1: P@$$w0rd
Scenario 2: P@$$$w0rd
Scenario 3: P@$w0rd
Scenario 3: P@$$w0rd

Actual behavior

Scenario 1:
image

Scenario 2:
image

Scenario 3:
image

Scenario 4:
image

Environment data

$PSVersionTable
image

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.