Skip to content

Commit f9e4c12

Browse files
committed
Updates to input validation logic. Added debugging.
1 parent 8986d17 commit f9e4c12

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Plaster/InvokePlaster.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,12 +547,15 @@ function Invoke-Plaster {
547547
$value = Read-Host -Prompt $prompt
548548
if (!$value -and $default) {
549549
$value = $default
550+
$patternMatch = $true
550551
}
551-
552-
if ($pattern) {
552+
elseif ($value -and $pattern) {
553553
if ($value -match $pattern) {
554554
$patternMatch = $true
555555
}
556+
else {
557+
$PSCmdlet.WriteDebug("Value '$value' did not match the pattern '$pattern'")
558+
}
556559
}
557560
} while (!$value -or !$patternMatch)
558561

0 commit comments

Comments
 (0)