Add variable in HTML

Team,

Please provide a sample code where I can call PS var in raw HTML language. convertto-html has some limitation & can’t go some advance formatting with convertto-html . Given a sample HTML code where I need to call PS variable.

<html>
<head>
<link rel="shortcut icon" href="icon link"/>
<title>NDES Certificates Expiry</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
div {
background-color: green;
}
</style>
</head>
<body>
<h3 style="color:white;">
<font face="Calibri"><center>test </center></font>
</body>
</html>

 

maybe this?

$HTML =
@"
<html>
<head>
<link rel=”shortcut icon” href=”icon link”/>
<title>NDES Certificates Expiry</title>
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″ />
<style type=”text/css”>
div {
background-color: green;
}
</style>
</head>
<body>
<h3 style=”color:white;”>
<font face=”Calibri”><center> VARIABLEHERE </center></font>
</body>
</html>
 
"@
 
$Variable = "VARIABLEHERE"
$ReplaceWith = "NEWSTUFF"
$HTMLReplaced = $HTML -replace $Variable,$ReplaceWith