I am searching for a string ($Loan_Id) in a file ($File_LoanData). I am able to find it, but should the string not be found, I need the script to continue. That does not seem to be working. Here is the problem line --
if ($Note_Line -eq $false) {Continue}
$Fie_LCExtract = "c:\temp\Fie_LCExtract.txt"
$File_LoanData = "c:\temp\File_LoanData.txt"
$File_LoanDataToday = "c:\temp\File_LoanDataToday.txt"
$r = [IO.File]::OpenText($Fie_LCExtract)
while ($r.Peek() -ge 0)
{
$Note = $r.ReadLine()
$Loan_Id = ($Note -split ';')[0].trim()
$Loan_Id = $Loan_Id -as [int]
if (($Loan_Id -is [int]) -eq $false) {Continue}
$Note_Line = Select-String -Path $File_LoanData -Pattern $Loan_Id
if ($Note_Line -eq $false) {Continue}
$Note_Line = ($Note_Line -split ':')[3].trim()
$Note_Line >> $File_LoanDataToday
}