Created
July 5, 2017 16:30
-
-
Save quonic/4e5629b8a48783998ad91d4994e30be5 to your computer and use it in GitHub Desktop.
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
| # Example of how to check for latest version | |
| [xml]$rssData = Invoke-WebRequest "http://pub.kb.fortinet.com/rss/firmware.xml" | |
| $MyDevice = "FortiOS" | |
| [Version]$MyDeviceVersion = "1.0.0" | |
| $rssData.rss.channel.item | ForEach-Object { | |
| [string]$TitleData = $_.title | |
| $a = $TitleData.Split(' ') | |
| $Title = $a[0] | |
| [Version]$Version = $a[1] | |
| if($MyDevice -match $Title -and $MyDeviceVersion -ne $Version){ | |
| "Update for $($Title.ToString()) v$($MyDeviceVersion) -> $($Version)" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment