Html portion
$html = @($htm)
$html = @"
<!doctype html>
<html lang="en">
<head>
<body>
text
$computername
$username
text
</body>
</html>
"@
$html | out-file c:\scripts\temp\Report.html
I have html language in the $html variable. When I decide to change the HTML code I need to go back into the PowerShell script. I'd rather just have the html in a separate file. How can I use get-content to place the contents of separate file into the $html = @"..."@ variable.
I am using powershell $variables in the html portion to make dynamic emails!
Dependent on your use case, a simple string replacement might work: