Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 553 Bytes

File metadata and controls

57 lines (36 loc) · 553 Bytes

File Content

I have a letter: letter.txt

Hi

My name is Anduin.

Bye

I read it:

$myLetter=cat letter.txt

Seems fine:

echo $myLetter

Hi

My name is Anduin.

Bye.

I check if it contains Hi:

$myLetter.Contains("Hi");

The output is:

True

But if I check if it contains name:

$myLetter.Contains("name");

The output is:

False

What a strange behavior of PowerShell! 😲

Repro env: Windows 10, PowerShell Core 7.0.3