是否可以在PowerShell if语句中使用-like和search-我正在尝试这样做;
$name = 'matt' $current = 'matt@' if ($name -like "*$current*"){ write-host("this name matches") }
但是,“$current”不工作-请告知?
voj3qocg1#
反过来也行
$name = 'matt@' $searchkey = 'matt' if ($name -like "*$searchkey*"){ write-output "this name matches" }
1条答案
按热度按时间voj3qocg1#
反过来也行