diff --git a/automatic/winscp.install/update.ps1 b/automatic/winscp.install/update.ps1 index b979d738243..f22c5ddbd01 100644 --- a/automatic/winscp.install/update.ps1 +++ b/automatic/winscp.install/update.ps1 @@ -1,7 +1,7 @@ Import-Module Chocolatey-AU $releases = 'https://winscp.net/eng/downloads.php' -$re = 'WinSCP.+\.exe$' +$re = 'WinSCP.+\.exe/download$' function global:au_SearchReplace { @{ @@ -24,7 +24,7 @@ function global:au_GetLatest { $url = @($download_page.links | Where-Object href -match $re) -notmatch 'beta|rc' | ForEach-Object href $url = 'https://winscp.net/eng' + $url $version = $url -split '-' | Select-Object -Last 1 -Skip 1 - $file_name = $url -split '/' | Select-Object -last 1 + $file_name = $url -split '/' | Select-Object -last 1 -Skip 1 @{ Version = $version URL32 = "https://sourceforge.net/projects/winscp/files/WinSCP/$version/$file_name/download" diff --git a/automatic/winscp.portable/update.ps1 b/automatic/winscp.portable/update.ps1 index 43fef873dd3..517c80733a2 100644 --- a/automatic/winscp.portable/update.ps1 +++ b/automatic/winscp.portable/update.ps1 @@ -1,7 +1,7 @@ Import-Module Chocolatey-AU $releases = 'https://winscp.net/eng/downloads.php' -$re = 'WinSCP.+Portable\.zip$' +$re = 'WinSCP.+Portable\.zip/download$' function global:au_SearchReplace { @{ @@ -33,7 +33,7 @@ function global:au_GetLatest { $url = @($download_page.links | Where-Object href -match $re) -notmatch 'beta|rc' | ForEach-Object href $url = 'https://winscp.net/eng' + $url $version = $url -split '-' | Select-Object -Last 1 -Skip 1 - $file_name = $url -split '/' | Select-Object -last 1 + $file_name = $url -split '/' | Select-Object -last 1 -Skip 1 @{ Version = $version URL32 = "https://sourceforge.net/projects/winscp/files/WinSCP/$version/$file_name/download"