msJinLei 2019-12-02 14:34:34 +08:00
Родитель 2eeeb5945e
Коммит 4815dac7f8
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -24,10 +24,10 @@ $cmdlets | ForEach-Object {
$cmdlet = $_.BaseName;
# First, match to module path.
$matchedRule = @($rules | Where-Object { $cmdletPath -cmatch ".*$($_.Regex).*" }) | Sort-Object {$_.Regex.Length} | Select-Object -Last 1;
$matchedRule = @($rules | Where-Object { $cmdletPath -cmatch ".*$($_.Regex).*" })[0];
# Try to match this cmdlet with at least one rule.
$possibleBetterMatch = @($rules | Where-Object { $cmdlet -cmatch ".*$($_.Regex).*" })| Sort-Object {$_.Regex.Length} | Select-Object -Last 1;
$possibleBetterMatch = @($rules | Where-Object { $cmdlet -cmatch ".*$($_.Regex).*" })[0];
# Look for the best match.
if(