We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This will return "Maintenance", "LTS" and "Current" Channels
Script:
# Get-NodeJS.ps1 # Define AppName $AppName = "NodeJS" $ReleaseUrl = "https://github.com/nodejs/Release?tab=readme-ov-file" Write-Verbose "Obtaining $($AppName) Release Versions from $($ReleaseUrl)...`n" # Main script to fetch and process links $Releases = @( @{Channel = 'Maintenance'; ReleasePattern = '(?s)rel="nofollow">(\d+\.x)</a></td>.?<td align="center"><strong>Maintenance</strong></td>'} @{Channel = 'LTS'; ReleasePattern = '(?s)rel="nofollow">(\d+\.x)</a></td>.?<td align="center"><strong>LTS</strong></td>'} @{Channel = 'Current'; ReleasePattern = '(?s)rel="nofollow">(\d+\.x)</a></td>.?<td\ align="center"><strong>Current</strong></td>'} ) $AppVersions = @( @{AppName = $($AppName); Platform = 'win'; Architecture = 'x64'; Type = 'msi'; URLPattern = 'node-v\d+\.\d+\.\d+-x64\.msi'} @{AppName = $($AppName); Platform = 'win'; Architecture = 'x64'; Type = 'zip'; URLPattern = 'node-v\d+\.\d+\.\d+-win-x64\.zip'} @{AppName = $($AppName); Platform = 'win'; Architecture = 'x64'; Type = '7z'; URLPattern = 'node-v\d+\.\d+\.\d+-win-x64\.7z'} @{AppName = $($AppName); Platform = 'win'; Architecture = 'x86'; Type = 'msi'; URLPattern = 'node-v\d+\.\d+\.\d+-x86\.msi'} @{AppName = $($AppName); Platform = 'win'; Architecture = 'x86'; Type = 'zip'; URLPattern = 'node-v\d+\.\d+\.\d+-win-x86\.zip'} @{AppName = $($AppName); Platform = 'win'; Architecture = 'x86'; Type = '7z'; URLPattern = 'node-v\d+\.\d+\.\d+-win-x86\.7z'} @{AppName = $($AppName); Platform = 'win'; Architecture = 'arm64'; Type = 'msi'; URLPattern = 'node-v\d+\.\d+\.\d+-arm64\.msi'} @{AppName = $($AppName); Platform = 'win'; Architecture = 'arm64'; Type = 'zip'; URLPattern = 'node-v\d+\.\d+\.\d+-win-arm64\.zip'} @{AppName = $($AppName); Platform = 'win'; Architecture = 'arm64'; Type = '7z'; URLPattern = 'node-v\d+\.\d+\.\d+-win-arm64\.7z'} ) foreach ($Release in $Releases) { $ChannelURL = (Get-Link -Uri $($ReleaseUrl) -MatchProperty outerHTML -Pattern (Get-Version -Uri $($ReleaseUrl) -Pattern $($Release.ReleasePattern))) if ($ChannelURL) { foreach ($AppVersion in $AppVersions) { $SearchCount = 1 # This may need increasing as future versions are released #Build each link with File Type specific versions # Check if Link to file download exists (arm64 is not available for earlier versions) if (Get-Link -Uri $($ChannelUrl) -MatchProperty href -Pattern $($AppVersion.URLPattern)) { $URL = (Resolve-Uri -Uri (Set-UriPrefix -Uri (Get-Link -Uri $($ChannelUrl) -MatchProperty href -Pattern $($AppVersion.URLPattern)) -Prefix $($ChannelURL))).Uri [version]$Version = Get-Version -String $URL $InstallInstructionsUrl = "https://nodejs.org/en/learn/getting-started/how-to-install-nodejs" $ReleaseNotesUrl = "https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V$($Version.Major).md" do { if ($URL) { New-NevergreenApp -Name $($AppVersion.AppName) -Version $($Version) -Uri $($URL) -Architecture $($AppVersion.Architecture) -Type $($AppVersion.Type) -Channel $($Release.Channel) break } $SearchCount-- } until ($SearchCount -eq 0) } else { $SearchCount-- } if ($SearchCount -eq 0) { Write-Verbose "`nWARNING: Could not find $($AppVersion.Architecture) release for $($AppName) v$($Version) in .$($AppVersion.Type) format`n" } } } Write-Verbose "$($AppName) (Version: $($Version)) Release notes are available here: $($ReleaseNotesUrl)" Write-Verbose "$($AppName) Install instructions are available here: $($InstallInstructionsUrl)" }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This will return "Maintenance", "LTS" and "Current" Channels
Script:
The text was updated successfully, but these errors were encountered: