0

I am working in a Software Deployment team, and I am working on a script, to automatically display monthly SW updates on a webpage. We have a Software that generates a HTML file consisting of a table with the information regarding the various SW.

The CSS and an excerpt of what the data looks like:

<style type="text/css"> .myTable {border-collapse:collapse; } 
        .myTable td { padding:2px;spacing:1px;border:1px solid #000000;} 
        </style>
<table Class="myTable">
    <tr>
        <td>
            <b>ID</b>
        </td>
        <td>
            <b>Name</b>
        </td>
        <td>
            <b>Vendor</b>
        </td>
        <td>
            <b>Severity</b>
        </td>
        <td>
            <b>Description</b>
        </td>
    </tr>
    <tr>
        <td>15539</td>
        <td>2460049_DEU</td>
        <td>Microsoft</td>
        <td>Service Pack</td>
        <td>Description of Office 2010 SP1</td>
    </tr>
    <tr>
        <td>15558</td>
        <td>2526291_DEU</td>
        <td>Microsoft</td>
        <td>Service Pack</td>
        <td>Description of Office Visio 2007 SP3 and of Office Visio Language Pack 2007 SP3</td>
    </tr>
</table>

The data gets posted to SAP JAM and looks like this:

current state

What I want to do is delete the column ID, and its values so the output will look like this:

desired state

My post is done with powershell and looks like the following

Invoke-WebRequest -Method Post -uri $uripath -Infile $htmlfile -Headers @{'Accept' = 'application/json'; 'Authorization'= 'Bearer TOKEN'; 'Content-Type'= 'text/html;type=blog'; 'Slug'= $description}

Does anybody know how to delete the column in an easy way via powershell and post the file with CSS to the website?

Thank you all in advance!

12
  • Hmm.. I have already answered that, but remember you kept commenting new requirements, while all it took was for you to have a look at what is possible with the Head parameter of ConvertTo-Html Commented Apr 9, 2020 at 13:29
  • @Tomalak, sounds interesting, how would I do this in this case? Am not very familiar with CSS Commented Apr 9, 2020 at 13:31
  • @Theo, thank you, didn't manage to get it done previously, but will try again Commented Apr 9, 2020 at 14:51
  • Does this answer your question? How to Convert HTML table to CSV file with same structure with powershell Commented Apr 9, 2020 at 18:05
  • How are you getting the HTML? Also invoke-webrequest? Commented Apr 9, 2020 at 22:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.