diff --git a/automatic/deluge/update.ps1 b/automatic/deluge/update.ps1 index 1ff2aa7ca..8a3efb274 100644 --- a/automatic/deluge/update.ps1 +++ b/automatic/deluge/update.ps1 @@ -22,7 +22,7 @@ function global:au_AfterUpdate($Package) { } function global:au_GetLatest { - $webpage = Invoke-WebRequest -Uri $releases + $webpage = Invoke-WebRequest -Uri $releases -UseBasicParsing $Files = $webpage.Links | Where-Object { $_.href -match '.exe$'} | Where-Object { $_.href -notmatch 'lt2'} | Select-Object -First 2 $url32 = "$($release)$($Files.href | Where-Object {$_ -match "win32"})" $url64 = "$($release)$($Files.href | Where-Object {$_ -match "win64"})" diff --git a/automatic/duplicatecleaner/update.ps1 b/automatic/duplicatecleaner/update.ps1 index e445fca7e..f63b3fc49 100644 --- a/automatic/duplicatecleaner/update.ps1 +++ b/automatic/duplicatecleaner/update.ps1 @@ -18,7 +18,7 @@ function global:au_AfterUpdate($Package) { } function global:au_GetLatest { - $page = Invoke-WebRequest -Uri $releases + $page = Invoke-WebRequest -Uri $releases -UseBasicParsing $url32 = "https://www.digitalvolcano.co.uk$(($page.Links | Where-Object {$_.href -match ".msi$"}).href)" $regexPattern = 'Version\s*(\d+(\.\d+)*)' $versionMatch = $page.Content | Select-String -Pattern $regexPattern -AllMatches diff --git a/automatic/eagle/update.ps1 b/automatic/eagle/update.ps1 index df749da4f..fb7b82ab3 100644 --- a/automatic/eagle/update.ps1 +++ b/automatic/eagle/update.ps1 @@ -18,14 +18,10 @@ function global:au_AfterUpdate($Package) { } function global:au_GetLatest { - $of = "$env:temp/eagle.exe" - Invoke-WebRequest -Uri $release -OutFile $of -UseBasicParsing - - [Version]$version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($of).ProductVersion.trim() - $checksumtype = $env:hash_algo - $checksum = Get-FileHash -Path $of -Algorithm $env:hash_algo - - $Latest = @{ URL64 = $release; Version = $version; Checksum64 = $checksum; ChecksumType64 = $checksumtype } + . ..\..\scripts\Get-FileVersion.ps1 + $FileVersion = Get-FileVersion $release + + $Latest = @{ URL64 = $release; Version = $FileVersion.Version; Checksum64 = $FileVersion.Checksum; ChecksumType64 = $FileVersion.ChecksumType } return $Latest } diff --git a/automatic/futuremark-systeminfo/update.ps1 b/automatic/futuremark-systeminfo/update.ps1 index 92d656738..ce741a4fa 100644 --- a/automatic/futuremark-systeminfo/update.ps1 +++ b/automatic/futuremark-systeminfo/update.ps1 @@ -17,7 +17,7 @@ function global:au_AfterUpdate($Package) { } function global:au_GetLatest { - $pageContent = Invoke-WebRequest -Uri $releases + $pageContent = Invoke-WebRequest -Uri $releases -UseBasicParsing $regexPattern = 'SystemInfo \s*(\d+(\.\d+)*)' $versionMatch = $pageContent.Content | Select-String -Pattern $regexPattern -AllMatches diff --git a/scripts/Get-FileVersion.ps1 b/scripts/Get-FileVersion.ps1 index a04345f0c..7d23e53e6 100644 --- a/scripts/Get-FileVersion.ps1 +++ b/scripts/Get-FileVersion.ps1 @@ -41,7 +41,7 @@ function Get-FileVersion { if($tempFile -match '\?') { $tempFile = $tempFile.Split('?')[0] } - Invoke-WebRequest -Uri $url -OutFile $tempFile + Invoke-WebRequest -Uri $url -OutFile $tempFile -UseBasicParsing try { [version]$version=$([System.Diagnostics.FileVersionInfo]::GetVersionInfo($tempFile).ProductVersion).trim() }