I use if else in my powershell script. in the if side, it works, but in the else side, It cannot return "Not Found" . It does not show any error.
if ($match.Groups.Count) { while ($match.Success) { Write-Host ("Match found: {0}" -f $match.Value) $match = $match.NextMatch() } } else { Write-Host "Not Found" }
if ($match.Groups.Count >0 )
if ($matching.Success) { while ($matching.Success) { "Match found: {0}" -f $matching.Value $matching = $matching.NextMatch() } } else { "Not Found" exit }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)