You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
$aAndB = $a `
-and $b
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.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: