fr33thytweaks / Ultimate-Windows-Optimization-Guide

181 stars 16 forks source link

`4 Installers\1 Installers.ps1` - `Notepad++` latest #11

Closed Obegg closed 3 days ago

Obegg commented 1 month ago

Instead of: https://github.com/fr33thytweaks/Ultimate-Windows-Optimization-Guide/blob/11f80fdb98fec74b2e342c2e1825b5556bb790e0/4%20Installers/1%20Installers.ps1#L190 Which you have to manually keep up-to-date

Use:

$npp = Invoke-WebRequest -UseBasicParsing 'https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/releases/latest' | ConvertFrom-Json
$nppPackage = 'x64.exe'
$dlUrl = $npp.assets | Where-Object { $_.name.Contains($nppPackage) -and !$_.name.Contains('.sig') } | Select-Object -ExpandProperty browser_download_url
$outfile = $npp.assets | Where-Object { $_.name.Contains($nppPackage) -and !$_.name.Contains('.sig') } | Select-Object -ExpandProperty name
$installerPath = Join-Path $env:temp $outfile

Which automatically get the latest version

fr33thytweaks commented 3 days ago

ive decided not to over complicate this script as this would fail if notepad change the website, ill just stick to a single version updates for notepad++ isnt a big deal imo. thankyou