Skip to content

Instantly share code, notes, and snippets.

@mrkwbr
Created April 17, 2020 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrkwbr/052d7cb3081a6510dab67eca5465a26b to your computer and use it in GitHub Desktop.
Save mrkwbr/052d7cb3081a6510dab67eca5465a26b to your computer and use it in GitHub Desktop.
pull latest NetApp software versions
#doesn't deal with auth - need to have logged in via browser first
function Get-NetAppSoftwareVersion {
[CmdletBinding()]
param ()
begin {
$URI = 'https://mysupport.netapp.com/api/sw-download-service/productdownloads'
$Results = @()
}
process {
$list = invoke-webrequest -uri $URI
$f = $list.content | convertfrom-json
foreach ($item in $f) {
$temp = Invoke-WebRequest -uri "https://mysupport.netapp.com/api/sw-download-service/productdownloads/$($item.id)/product-download-details?language=en&id=$($item.id)"
$temp = $temp.content | ConvertFrom-Json
$temp | Add-Member NoteProperty software $item.value
$temp | Add-Member NoteProperty softwareid $item.id
$Results += $temp
Start-Sleep 2
}
$Results
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment