{"id":10022,"date":"2017-05-08T11:38:16","date_gmt":"2017-05-08T10:38:16","guid":{"rendered":"https:\/\/myworldofit.net\/?p=10022"},"modified":"2017-05-09T10:24:20","modified_gmt":"2017-05-09T09:24:20","slug":"powershell-script-to-download-an-rss-feed-and-alert-when-there-are-new-posts","status":"publish","type":"post","link":"https:\/\/myworldofit.net\/?p=10022","title":{"rendered":"PowerShell script to download an RSS feed and alert when there are new posts"},"content":{"rendered":"<p>One of my favourite features of PowerShell is the <strong>Invoke-RestMethod<\/strong> cmdlet which (among a great many other things) can <strong>download the data from an RSS feed<\/strong>. One application I&#8217;ve found for this is to stay on top of <strong>security bulletins<\/strong> from organisations like <strong>Adobe<\/strong> and <strong>Drupal<\/strong>.<\/p>\n<p>However just downloading the data from the feed and kicking it out in an email isn&#8217;t quite good enough for my needs thus the script below gets data from a CSV which contains the URL to the feed as well as some<strong> extra details to inject into any email notification<\/strong> (e.g. a link to the guide on how to deploy Adobe Updates).<\/p>\n<p>In my production environment this script creates tickets on&nbsp;a FreskDesk helpdesk to log and manage any new update notifications. In the attached example below the script just fires off email notifications.<\/p>\n<p>Have a look at the screenshot sequence below for more info!<\/p>\n<p>ngg_shortcode_0_placeholder<div class=\"wp-downloadmanager\"><p><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"wp-downloadmanager-sprite\" aria-hidden=\"true\" focusable=\"false\"><symbol id=\"wp-downloadmanager-icon-file\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-archive\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M11 3h2v2h-2zM11 6h2v2h-2zM11 9h2v2h-2zM10.5 13h3v3.5h-3z\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-audio\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M10 18.5v-5l5-1.5v5\" \/><circle cx=\"9\" cy=\"18.5\" r=\"1.4\" \/><circle cx=\"14\" cy=\"17\" r=\"1.4\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-code\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M10.5 12.5 8 15.5l2.5 3M13.5 12.5 16 15.5l-2.5 3\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-document\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M9 12.5h6M9 15.5h6M9 18.5h4\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-image\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><circle cx=\"10\" cy=\"13.5\" r=\"1.1\" \/><path d=\"M8 19.5l3-3 2 2 3-3.5 2 4.5z\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-presentation\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M9 19.5v-3M12 19.5v-5.5M15 19.5v-8\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-spreadsheet\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M8 12.5h8v7H8zM8 16h8M11.5 12.5v7\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-video\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M10.5 13.5l5 3-5 3z\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-application\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><circle cx=\"12\" cy=\"16.5\" r=\"2\" \/><path d=\"M12 12.5V14M12 19v1.5M8.5 16.5H10M14 16.5h1.5\" \/><\/symbol><\/svg><svg class=\"wp-downloadmanager-icon\" aria-hidden=\"true\" focusable=\"false\"><use href=\"#wp-downloadmanager-icon-archive\" \/><\/svg>&nbsp;&nbsp;<strong><a href=\"https:\/\/myworldofit.net\/download\/37\/\">Get-Rss<\/a><\/strong> (4.0 KiB, 3,399 hits)<\/p><\/div><\/p>\n<p><strong>Update 09\/05\/2017 &#8211; v0.2 &#8211; <\/strong>Now handles XML and Arrays in the link and title objects (good for reddit and blogspot!)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of my favourite features of PowerShell is the Invoke-RestMethod cmdlet which (among a great many other things) can download the data from an RSS feed. One application I&#8217;ve found for this is to stay on top of security bulletins from organisations like Adobe and Drupal. However just downloading the data from the feed and kicking it out in an&#8230; <a class=\"read-more\" href=\"https:\/\/myworldofit.net\/?p=10022\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[11,20,22],"tags":[385,383,386,248,384,382],"series":[],"class_list":["post-10022","post","type-post","status-publish","format-standard","hentry","category-servers","category-software","category-the-cloud","tag-api","tag-freshdesk","tag-invoke-restmethod","tag-powershell","tag-rest","tag-rss"],"_links":{"self":[{"href":"https:\/\/myworldofit.net\/index.php?rest_route=\/wp\/v2\/posts\/10022","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myworldofit.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myworldofit.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myworldofit.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myworldofit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10022"}],"version-history":[{"count":4,"href":"https:\/\/myworldofit.net\/index.php?rest_route=\/wp\/v2\/posts\/10022\/revisions"}],"predecessor-version":[{"id":10034,"href":"https:\/\/myworldofit.net\/index.php?rest_route=\/wp\/v2\/posts\/10022\/revisions\/10034"}],"wp:attachment":[{"href":"https:\/\/myworldofit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myworldofit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myworldofit.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10022"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/myworldofit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=10022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}