As I have been unable to find a current RSS feed for windows updates I am trying to parse some data from the Microsoft support site. I can dynamically build the URL as the only bits that will change are the numbers of the knowledge base article. I am interested in the text below where it say Summary but cant find a method to extract this information with Invoke-Webrequest
it seemed to me that you are doing everything right, but when you output the complete raw result of the request, it doesn’t seem to be anything useful. So I tried using the Internet Explorer COM Object through PS and it worked. Not pretty, but gets the result you are looking for:
Just when I thought it was safe to go back into the water
When I use the following :-
$ie = new-object -ComObject “InternetExplorer.Application”
$ie.silent = $true
$web =“Win32k information disclosure vulnerability: June 13, 2017”
$ie.navigate($web)
$result = “”
$result = $ie.document.body.getElementsByClassName(“container section-body”) | select -ExpandProperty innertext
$kbarticle = $result -split “Symptom” | select -first 1
$ws.cells.item($intRow,4) = $kbarticle
$ws.cells.item($intRow,5) = $web
It writes the contents of $kbarticle to the cell in excel (ok I have not included to code to open excel here) but there are 2 carriage returns at the top of the data so in order to see the data you have to click into the cell (I spent hours thinking it wasn’t writing the data before I spotted the 2 Carriage returns ). I have tried $kbarticle.Trim() but that does not seem to work. Any ideas