DanGough / Nevergreen

This module is an alternative to Evergreen, and allows you to find the latest version and download URL for various Windows apps. Evergreen uses API queries to obtain its data whereas this module is more focussed on web scraping. This is more prone to breaking when websites are changed, hence the name.
The Unlicense
72 stars 16 forks source link

Add Notepad3 #11

Closed JonathanPitre closed 2 years ago

JonathanPitre commented 3 years ago

https://www.rizonesoft.com/downloads/notepad3

We can improve the following code with Nevergreen standard.

$webRequest = Invoke-WebRequest -UseBasicParsing -Uri ("https://www.rizonesoft.com/downloads/notepad3") -SessionVariable websession
$regexURL = "https\:\/\/www\.rizonesoft\.com\/download\/\d.+/"
$regexZip = "Notepad3_\d.\d{2}.\d{3}.\d_Setup.zip"
$appURL = $webRequest.RawContent | Select-String -Pattern $regexURL -AllMatches | ForEach-Object { $_.Matches.Value } | Select-Object -First 1
$appZip = $webRequest.RawContent | Select-String -Pattern $regexZip -AllMatches | ForEach-Object { $_.Matches.Value } | Select-Object -First 1
$appVersion = $appZip.Split("_")[1]
$appSetup = "Notepad3_$($appVersion)_Setup.exe"
DanGough commented 2 years ago

Added in Dev