Skip to content

Instantly share code, notes, and snippets.

@quonic
Created July 5, 2017 16:30
Show Gist options
  • Select an option

  • Save quonic/4e5629b8a48783998ad91d4994e30be5 to your computer and use it in GitHub Desktop.

Select an option

Save quonic/4e5629b8a48783998ad91d4994e30be5 to your computer and use it in GitHub Desktop.
# 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