Created
June 23, 2016 01:58
-
-
Save schwartzmx/be6ad4542f22adbc81a7f8ce0552513a to your computer and use it in GitHub Desktop.
A simple PowerShell script to read the RSS feed for SQL Server KB support updates
This file contains hidden or 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
<# | |
Author: Phil Schwartz | |
Description: A simple script to read the RSS feed for SQL Server KB support updates | |
- Allows stepping through the feed and opening in browser, if specified | |
#> | |
[xml]$xmldoc= Invoke-WebRequest 'https://support.microsoft.com/en-us/rss?rssid=1044' | |
$feed = $xmldoc.rss.channel | |
$lid = 0 | |
Write-Host "" | |
Write-Host $feed.title -ForegroundColor yellow | |
Write-Host $feed.description -ForegroundColor yellow | |
Write-Host $feed.link -ForegroundColor yellow | |
ForEach ($msg in $feed.Item){ | |
[PSCustomObject]@{ | |
'PublishDate' = [datetime]$msg.pubDate | |
'Title' = $msg.title | |
'Description' = $msg.description | |
'Link' = $msg.link | |
'LinkID' = $lid | |
} | |
$lid += 1 | |
Write-Host "Press [Enter] to continue, [o] to open the link, any other key to quit.`r`n" -ForegroundColor yellow | |
$k = [Console]::ReadKey($true) | |
If ($k.Key -eq "o") { | |
# opens as a tab in default browser | |
start $($msg.link) | |
} | |
ElseIf ($k.Key -eq "Enter") { | |
Continue | |
} | |
Else { | |
Exit | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment