Skip to content

Commit 23abcb0

Browse files
author
James Brundage
committed
Updating Search-PipeScript (fixing match condition) (#115)
1 parent c5d33f1 commit 23abcb0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Search-PipeScript.ps1.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function Search-PipeScript
119119
elseif ($astType -is [Regex]) {
120120
[scriptblock]::Create((
121121
'param($ast)
122-
$ast.GetType().Name -match ([Regex]::New(' +
122+
$ast.GetType().Name -match ([Regex]::New(' +
123123
$astType.ToString().Replace("'", "''") + "','" +
124124
$astType.Options + "','" +
125125
$(if ($AstType.MatchTimeout -lt 0) {
@@ -129,8 +129,8 @@ function Search-PipeScript
129129
}) + '))'
130130
))
131131
}
132-
elseif ($astType -as [regex]) {
133-
[ScriptBlock]::Create('param($ast) $ast.GetType().Name -match ' + $astType +'')
132+
elseif ($astType -as [regex]) {
133+
[ScriptBlock]::Create('param($ast) $ast.GetType().Name -match "'+ $astType +'"')
134134
} else {
135135
[ScriptBlock]::Create('param($ast) $ast.GetType().Name -like "*' + $astType +'*"')
136136
}

0 commit comments

Comments
 (0)