Last active
October 10, 2021 05:30
-
-
Save nathanmcnulty/d7b73eb7d988971af749927f5b284de3 to your computer and use it in GitHub Desktop.
Gets a list of fully qualified Rockwell updates and stores them in $results
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[array]$results = "Recommendation,CPR,OS,KB,URL" | |
(Invoke-WebRequest -Uri "https://www.rockwellautomation.com/ms-patch-qualification/Tabs3_new.htm").links.href | ForEach-Object { | |
$response = Invoke-WebRequest -Uri "https://www.rockwellautomation.com/$_" | |
[array]$content = $response.ParsedHtml.body.innerHTML -split "`r`n" | Where-Object { $_ -match '<TD class' } | ForEach-Object { $_.Split('<>')[2..3] } | Where-Object { $_ -ne "" } | |
$content | ForEach-Object { | |
if ($_ -eq "Fully Qualified") { $fq = $true } | |
if ($fq) { | |
if ($_ -like "SR*") { $sr = $_} | |
if ($_ -in "2012R2","Win8_1x64","2016","Win10","2019","Win10_20H2") { $os = $_} | |
if ($_ -like "*support.microsoft.com*") { $url = $_.Split('"')[1] } | |
if ($url) { | |
$kb = $url.Split('/')[-1] | |
$results += "Fully Qualified,$sr,$os,$kb,$url" | |
"fq","sr","url","kb" | ForEach-Object { Remove-Variable $_ } | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment