PowerShell - Operators
Identify the error in this PowerShell code snippet:
$str = 'PowerShell'
if ($str -like '[Pp]ower*') { 'Yes' }$str = 'PowerShell'
if ($str -like '[Pp]ower*') { 'Yes' }-like operator supports wildcards but does not support character classes like [Pp].-match, but not in -like. So the pattern is invalid for -like.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions