Help needed to create a tables in Powershell

Can someone guide me where to start creating table format to be included in the body of the email in HTML format to look something like this with an company logo in top left?

I was able to get it to work using an HTML file and using Get-Content in the Powershell. but due to security reason the start and end time values show up blank in the email because it blocks javascript.

Max,
Welcome to the forum. :wave:t4:

I googled “powershell html reports” for you and this are the first 3 hits:

:smirk:

Is there a way to add the following HTML code in a Powershell script?


<style type="text/css">
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
  overflow:hidden;padding:10px 5px;word-break:normal;}
.tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
  font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
.tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top}
</style>
<table class="tg">
<thead>
  <tr>
    <th class="tg-0pky"><span style="font-weight:bold;color:#000">Impact:</span></th>
    <th class="tg-0pky"><span style="background-color:transparent">The application and servers will be unavailable during the maintenance windows for:</span><br><br>QA</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td class="tg-0pky"><span style="font-weight:bold">Environment:</span></td>
    <td class="tg-0pky"><span style="background-color:transparent">Non-Production</span></td>
  </tr>
  <tr>
    <td class="tg-0pky"><span style="font-weight:bold">Scheduled Start Time:</span></td>
    <td class="tg-0pky"><span style="background-color:transparent">08/15/2022 12:00 AM CT</span></td>
  </tr>
  <tr>
    <td class="tg-0pky"><span style="font-weight:bold">Scheduled End Time:</span></td>
    <td class="tg-0pky"><span style="background-color:transparent">08/15/2022 02:00 AM CT</span></td>
  </tr>
  <tr>
    <td class="tg-0pky"><span style="font-weight:bold">Region:</span></td>
    <td class="tg-0pky"><span style="background-color:transparent">All</span></td>
  </tr>
  <tr>
    <td class="tg-0pky"><span style="font-weight:bold">Contact:</span></td>
    <td class="tg-0pky"><span style="background-color:transparent">If you have questions or concerns in advance of this maintenance, please contact email address. </span></td>
  </tr>
</tbody>
</table>

What exactly do you mean with “adding” HTML code in a PowerShell script? You could save it as a template in a file and read that file from a PowerShell script.

Please keep in mind - we cannot see your screen and we cannot read your mind. If you need help with a particular piece of code you wrote you should share this code here. So we might be able to help you further.