# If you have data between td's then you need to send the email`
`if ($regex.IsMatch($regexsubject)){`
` if ($totalUpdates -ne 0) {
$smtp = New-Object Net.mail.SmtpClient -ArgumentList $smtpServer
$smtp.Credentials = New-Object System.Net.NetworkCredential($smtpUsername, $smtpPassword);
$msg = New-Object Net.mail.MailMessage
$msg.From = $emailFrom
$msg.To.Add($mailto)
$msg.subject ="Update et/ou reboot en attente sur $computer"
$msg.IsBodyHtml = $true
$msg.Body = $HTMLmessage
$smtp.Send($msg)
}
}
Yeppers, on the backticks on what you have. They have their place, jus not how you are using them.
PowerShell has many natural line continuation possibilities, backtick, in most case should be the very last option to use, but that does not mean they should not be used. Dispute what this write up says:
Bye Bye Backtick: Natural Line Continuations in PowerShell
Most of this article is on the money though.
Also, semi-colons at the end don’t do anything. Semi-colons in PS say, the code before and after it have nothing to do with each other. I see this a lot from folks coming to PS from other languages. They are not really a thing in PS proper, but like backtick, they do have a use case in some cases, but not in what you are doing.