![]() ![]()
I'm hoping this will work with a hidden ie window and under the SYSTEM user. I can pull the links for each page and process them like the initial script in the original post. This successfully opens the browser and clicks the next button on the page. $next=$ie.Document.getElementById("ctl00_catalogBody_nextPageLinkText") $links=$ie.Document.IHTMLDocument2_links | where-object id -like '*_link' $ie = New-Object -com internetexplorer.application I came up with the following bit of code. I was able to piece together the following thanks to a post on SuperUser, the Microsoft documentation for the Internet Explorer object, and the autocomplete feature inside VSCode. :(Īfter doing a bit more searching, I stumbled upon the fact that PowerShell can use com objects, and one of those com objects happens to be IE. At one time Microsoft did have a RSS feed that you could use for a query and there is still a link on the page, but it no longer functions. WINDOWS UPDATE CATALOG WINDOWSI also found a blog post on using Windows Update from the system itself, but some hotfixes may not display when using this data. If you have any pointers or resources I could reference, I would most appreciate it. I'm not really sure where to go from here on getting powershell to perform the _doPostBack function that javascript handles currently on the page. I will note that using multiple query values like "2020-08" "Windows 10" "圆4" "1909" does limit the results enough to fit on one pages (probably) to where I could use the script in the first link, but I've found that the filtering the Microsoft Update site uses isn't always the best, so I would rather perform the filtering in powershell, which means I need to be able to follow the next page links. This is the form data from the source for the Microsoft Update Catalog webpage, although I'm not sure what I would do with it. The bit of research I've done on this and determined that the _doPostBack function pushes data to the webform which then in turn provides the new data when the page reloads. The site uses a javascript:_doPostBack( 'ctl00$catalogBody$nextPageLinkText','') for the next button instead of the next page data being part of the URL. WINDOWS UPDATE CATALOG HOW TOI'm not quite sure how to get powershell to follow the next page links though. However for searching something like all the updates released this past month " 2020-08", it will span several pages. It's fine when using this as the script was intended with supplying a specific KB number as these query results will never be beyond one page. (Invoke-WebRequest -Uri "$KB").Links | Where-Object id -like '*_link' ![]() It's basically executing the following, then parsing the results: $KB="KB4566116" WINDOWS UPDATE CATALOG DOWNLOADWhile it does work, it will only get the download links from the first page and does not support multiple pages. The first link is the most optimal as it has the smallest footprint. While this script is slick, it doesn't meet my needs due to the 1GB download required. ![]() This file has to be downloaded on every use in order to obtain the most recent catalog information. That's a lot of download bandwidth needed to use this regularly or pushed to multiple machines through our remote management tools. This one would work for my use, but it is about a 1GB download for that cab file just to extract a 90 MB xml. I also found an alternate method of extracting the catalog xml from the WSUS cab file here: I found that someone already wrote a partial script to do that here: I could then filter out all the preview updates and be left with a small number that are needed. So for instance, I could specify "2020-09" (Updates for September 2020), for the query, and it would return back a matching list of all KBs along with download links that correspond with the system. WINDOWS UPDATE CATALOG INSTALLMy goal with all of this is to have a way to find the updates which match the computer the script is ran on, and possibly check to see that an update is installed or install a specific update without needing to specify a KB number for each and every platform. I've been doing some digging off and on with how to get Powershell to query the Microsoft Update Catalog automatically. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |