I am running several different types of validations on my deployment process. For each validation I'd like to add some html code to an array. At the end of the script I'd like to take the entire array of code and email it out.
The code I currently have to send the email is the following
$sendMessage = @{
Subject = "Problem: Web Config Blanks"
Body = "
<p>The Deployment Validation script has found at least 1 problem</p>
<UL>
<LI> There are " + $errorWcBlanksCt + " web config values that are blank
</UL>"
From = "[email protected]"
To = "[email protected]"
SmtpServer = "0.0.0.0"
}
send-mailmessage @sendMessageWcBlanksCt -BodyAsHtml
Write-Host "Web config has been parsed and emailed"
Obviously this one is just for a validation that checks blank values in web.configs. If I were to add in a validation for total file count for example, how could I have an additional <LI> line, but only if the file count is what the script defines as "wrong"?
<LI> There are " + $errorWcBlanksCt + " web config values that are blankand I would simply make itbody = "<p>The Deployment Validation...</p><UL> $collection </UL>