diff --git a/Evergreen/Apps/Get-ProtonDrive.ps1 b/Evergreen/Apps/Get-ProtonDrive.ps1 index 36326df0..5e2cc57b 100644 --- a/Evergreen/Apps/Get-ProtonDrive.ps1 +++ b/Evergreen/Apps/Get-ProtonDrive.ps1 @@ -16,9 +16,15 @@ function Get-ProtonDrive { } $Updates = Invoke-EvergreenRestMethod @params - # Update feed may include duplicate keys in the JSON + # Convert the update JSON string if ($Updates -is [System.String]) { - $Updates = $Updates | ConvertFrom-Json -ErrorAction "Stop" + try { + $Updates = $Updates | ConvertFrom-Json -ErrorAction "Continue" + } + catch { + # Update feed may include duplicate keys in the JSON + $Updates = $Updates -creplace $res.Get.Update.ReplaceString, "" | ConvertFrom-Json -ErrorAction "Stop" + } } # Sort for the latest version diff --git a/Evergreen/Manifests/ProtonDrive.json b/Evergreen/Manifests/ProtonDrive.json index e8c2e2e0..9c9c63d5 100644 --- a/Evergreen/Manifests/ProtonDrive.json +++ b/Evergreen/Manifests/ProtonDrive.json @@ -4,7 +4,8 @@ "Get": { "Update": { "Uri": "https://proton.me/download/drive/windows/version.json", - "DatePattern": "yyyy-MM-dd" + "DatePattern": "yyyy-MM-dd", + "ReplaceString": "(\\s+\\\"Sha512Checksum\\\":\\s+\\\".*\\\"\\,)" } }, "Install": {