File Content
PowerShell reads file line by line, which works like .NET 's File.ReadAllLine(). which means, the $myLetter is a string array.
And $myLetter.Contains("Hi"); only searches in the first child of the array.
Space after `
This is obvious. ` escape any character in pwsh. Without the space, pwsh will escape the LF, and will seize
as one expression.
But with the space, ` will escape the space instead of the LF. and will seize the codes as two expressions.
$aAndB = $a will set $aAndB to true
-and $b is invalid and will be ignored.
In powershell, theory and practice are combined: Nothing works and nobody knows why.
File Content
PowerShell reads file line by line, which works like .NET 's
File.ReadAllLine(). which means, the$myLetteris a string array.And
$myLetter.Contains("Hi");only searches in the first child of the array.Space after `
This is obvious. ` escape any character in pwsh. Without the space, pwsh will escape the LF, and will seize
as one expression.
But with the space, ` will escape the space instead of the LF. and will seize the codes as two expressions.
$aAndB = $awill set$aAndBto true-and $bis invalid and will be ignored.