Created
April 17, 2020 15:24
-
-
Save mrkwbr/052d7cb3081a6510dab67eca5465a26b to your computer and use it in GitHub Desktop.
pull latest NetApp software versions
This file contains 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
#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