Closed indented-automation closed 9 months ago
Totally agree, I will fix this in the next release. Sorry for the late reply.
I fixed the .Contains
issue where it impacted the operation of the module by setting the compared strings to lowercase. In many cases it's just a sanity check and it wouldn't have changed anything to switch to another type of operand.
The code in this module makes significant use of
.Contains
to look for sub-strings. For example:However, the
.Contains
method of System.String is case-sensitive and, in win PS (.NET Framework), has no overloads available to make ignore case.This use of
.Contains
will yield false and you'll miss things:I suggest one of:
-match
. For example:$exePath -match 'powershell'
$exePath.ToLower().Contains...
$exePath.IndexOf('powershell', [StringComparer]::OrdinalIgnoreCase) -gt -1