Case Insensitive

Welcome Forums General PowerShell Q&A Case Insensitive

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
3 years, 8 months ago.

  • Author
    Posts
  • #24973

    Participant
    Points: 0
    Rank: Member

    Is there away to make the Replace function case insensitive.

    Replace('Host="ACfile01"','Host="vCHPprt02"')

    I also want to be able to replace the following line

    Replace('Host="ACFile01"','Host="vCHPprt02"')

  • #24974

    Participant
    Points: 0
    Rank: Member

    You could use the -replace operator instead of the .Replace() method.

    "FooBar" -replace "foo","Tango"

The topic ‘Case Insensitive’ is closed to new replies.