Downloads:
1,119
Downloads of v 0.2.0:
8
Last Update:
07 Jul 2025
Published Date:
07 Jul 2025
Package Maintainer(s):
Software Author(s):
- Teknowledgist
Tags:
- Software Specific:
- Software Site
- Software Source
- Software License
- Software Issues
- Package Specific:
- Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
Latest Release on GitHub Helper
(Ready for review)
- 1
- 2
- 3
0.2.0 | Updated: 07 Jul 2025
- Software Specific:
- Software Site
- Software Source
- Software License
- Software Issues
- Package Specific:
- Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
Downloads:
1,119
Downloads of v 0.2.0:
8
Published:
07 Jul 2025
Maintainer(s):
Software Author(s):
- Teknowledgist
Latest Release on GitHub Helper 0.2.0
(Ready for review)
Legal Disclaimer: Neither this package nor Chocolatey Software, Inc. are affiliated with or endorsed by Teknowledgist. The inclusion of Teknowledgist trademark(s), if any, upon this webpage is solely to identify Teknowledgist goods or services and not for commercial purposes.
- 1
- 2
- 3
All Checks are Passing
3 Passing Tests
This version is in moderation and has not yet been approved. This means it doesn't show up under normal search.
- Until approved, you should consider this package version unsafe - it could do very bad things to your system (it probably doesn't but you have been warned, that's why we have moderation).
- This package version can change wildly over the course of moderation until it is approved. If you install it and it later has changes to this version, you will be out of sync with any changes that have been made to the package. Until approved, you should consider that this package version doesn't even exist.
- You cannot install this package under normal scenarios. See How to install package version under moderation for more information.
- There are also no guarantees that it will be approved.
There are versions of this package awaiting moderation (possibly just this one). See the Version History section below.
Are you a Chocolatey package maintainer for software released on GitHub? Have you noticed that GitHub has made it increasingly difficult to scrape pages for information on the latest release?
The Latest Release on GitHub Helper can help you!
Maybe you use AU or maybe you have another process for updating your packages. Regardless, you no longer need to parse raw HTML to nab the version or to snag the URL for the download. This package gives you a PowerShell function that leverages the GitHub API so that you to easily check for the latest version of any (public) project. It can be as simple as:
$Release = Get-LatestReleaseOnGitHub -URL https://www.github.com/ownername/repositoryname
$version = $Release.Tag.trim('v.')
$URL = $Release.Assets | Where-Object {$_.FileName -match '\.exe'} | Select-Object -ExpandProperty DownloadURL
The $Release
object will contain the name of the latest release, the principle tag (which usually contains the version), the description, the URLs for the "zipball" and "tarball" of the release code, and finally, information on each of the "assets" (i.e. files) for the release like the filename, date, size, full download URL, and the SHA256 checksum (if available).
Sure, you can do this yourself by installing the PowerShellForGitHub module and reading the documentation, but that's overkill for what you need to do. Install this package and keep it simple. It even has a shortened alias:
Note for maintainers with LOTS of packages
The GitHub API has a speed limit of 60 queries per hour. If you have so many packages or check for updates so often that you might exceed that limit, you can create an Access Token. The Token needs no special scope or permissions and will allow you to make up to 5000 queries per hour. (Surely that is enough!) This package allows you to provide the token as a one-time thing (less safe), or have it cached so you only need to provide it once on each computer you use.
Examples:
Get-LARGH -URL https://github.com/ownername/repositoryname -AccessToken a1b2c3d4e5f6g7h8i9j0
This will use the token just one time. Other than a quick test, this is not particularly helpful unless you are going to put your access token in plaintext in your code (not a good idea!), but you do things your way.Get-LARGH -URL https://github.com/ownername/repositoryname -TokenAsCred
This will request the token in a credential window and then store it encrypted within the user profile. All future uses of the function will use the cached credential without needing the switch until the-credential
switch is used again and an empty/blank password is provided.
Requirements
- PowerShell v3
$ErrorActionPreference = 'Stop'
$toolsPath = Split-Path $MyInvocation.MyCommand.Definition
$ModuleDir = $env:psmodulepath.split(';') | Where-Object {$_ -like "$env:programfiles*"} | Select-Object -first 1
# remove the old version for an upgrade
Remove-Item -Force -Recurse "$ModuleDir\LaRGH" -ErrorAction ignore
Write-Host "LaRGH module successfully removed from this system."
#
# Module manifest for module 'LaRGH'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'LaRGH.psm1'
# Version number of this module.
ModuleVersion = '0.1'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniquely identify this module
GUID = 'bf45ddd2-ae6e-4034-895c-2b9ecd56b612'
# Author of this module
Author = 'Teknowledgist'
# Company or vendor of this module
CompanyName = 'Unknown'
# Copyright statement for this module
Copyright = '(c) 2022 Teknowledgist. All rights reserved.'
# Description of the functionality provided by this module
Description = 'Retrieving the latest release of a project on GitHub'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''
# Minimum version of the Windows PowerShell host required by this module
# PowerShellHostVersion = ''
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# CLRVersion = ''
# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
# RequiredModules = @()
# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()
# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = 'Get-LatestReleaseOnGitHub'
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = '*'
# Variables to export from this module
VariablesToExport = '*'
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = 'Get-LaRGH'
# DSC resources to export from this module
# DscResourcesToExport = @()
# List of all modules packaged with this module
# ModuleList = @()
# List of all files packaged with this module
# FileList = @()
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{
PSData = @{
# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'chocolatey', 'update'
# A URL to the license for this module.
LicenseUri = 'https://www.gnu.org/licenses/gpl-3.0.html'
# A URL to the main website for this project.
ProjectUri = 'https://github.com/teknowledgist/Chocolatey-packages/tree/master/manual/largh'
# A URL to an icon representing this module.
# IconUri = ''
# ReleaseNotes of this module
ReleaseNotes = ''
} # End of PSData hashtable
} # End of PrivateData hashtable
# HelpInfo URI of this module
HelpInfoURI = ''
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''
}
<#
.SYNOPSIS
Gathers info on the latest release of a project on GitHub
.Description
GitHub has made it very difficult to scrape their web pages for information
about a project. They do have a comprehensive API however. This script
API calls to collect information about the latest release of a project. In
particular, it gathers the tag (typically containing the version), the
description and the name, date, size, and download URL of all the assets
for the release.
The API does have a "speed limit" of 60 queries per hour. In most, expected
use-cases for this script (primarily for Chocolatey Automatic Update packages),
users won't come close to that limit. If the limit is a concern, this
script can accept, collect and cache (encrypted), or read a cached API Key
("Personal Access Token":
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
to increase the limit to 5000 queries per hour.
.Parameter URL
(Required) The URL to the GitHub repository in the form: "https://[www.]github.com/<owner>/<repo>
.Parameter AccessToken
The actual API Key as a plaintext string. This is not a recommended option,
but if the API Key is needed and available as plain text this is how to provide
it.
Default Value: <none>
.Parameter TokenAsCred
Script will open a credential request window to collect the API Key in the
password field (while ignoring any value provided in the username field).
The value will be cached as an secure string for future use.
Default value: $false
.Output
A custom object containing the release name, release tag (typically, the
version), the description and all the asset values of name, date, size, and
download URL for the release.
.Example
Get-LatestReleaseInfo -URL 'https://github.com/torakiki/pdfsam'
Information for the latest release of PDFSam will be collected and returned.
If an encrypted personal access token is found in the user profile, it will
be used to authenticate to GitHub. If one is not found, the information will
still be collected unless there have been more than 60 previous queries
within the hour.
.Example
Get-LatestReleaseInfo -URL 'https://github.com/torakiki/pdfsam' -AccessToken <plaintext token>
The same query and results as above, but the provided access token will be
used and will not be stored anywhere.
.Example
Get-LatestReleaseInfo -URL 'https://github.com/torakiki/pdfsam' -TokenAsCred
This will first request credentials in which the user can provide any username
and a GitHub Personal Access Token for the password. The access token will be
stored encrypted within the user profile, and information for the latest release
of PDFSam will be collected and returned as above.
.Notes
Copyright 2022 Teknowledgist
This script/information is free: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 2 of the
License, or (at your option) any later version.
This script is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
The GNU General Public License can be found at <http://www.gnu.org/licenses/>.
#>
Function Get-LatestReleaseOnGitHub {
[CmdletBinding(DefaultParametersetName='Token')]
Param(
[Parameter(Position=0)]
[ValidateNotNullOrEmpty()]
[string]$URL = $null,
[Parameter(ParameterSetName='Token',Position=1)]
[ValidateNotNullOrEmpty()]
[string]$AccessToken = $null,
[Parameter(ParameterSetName='Creds',Position=1)]
[Switch]$TokenAsCred
)
if ($URL -match '^https?://(?:www.)?github\.com/([^/]+)/?([^/]+)?(?:/.*)?$') {
$ownerName = $Matches[1]
if ($Matches.Count -gt 2) {
$repositoryName = $Matches[2]
}
} else {
Write-Warning "URL must be in the form 'http[s]://[www.]github.com/<owner>/<repo>'."
Throw 'URL not in recognized form.'
}
$LatestURL = "https://api.github.com/repos/$OwnerName/$RepositoryName/releases/latest"
$headers = @{
'Accept' = 'application/vnd.github.v3+json'
'User-Agent' = 'GetLatest@GitHub'
}
$accessTokenFilePath = Join-Path $env:LOCALAPPDATA 'LatestReleaseOnGH\accessToken.txt'
if ($PSBoundParameters.ContainsKey('TokenAsCred')) {
# Collect the access token in a PSCredential object
$CredMessage = 'Provide your GitHub API Token in the Password field. The username field is required but will be ignored.' +
' ***The API Token will be cached across PowerShell sessions. If the password is blank, any cached password will be erased. ***'
$Credential = Get-Credential -Message $CredMessage
if ([String]::IsNullOrWhiteSpace($Credential.GetNetworkCredential().Password)) {
# Erase any existing cached token when an empty credential is provided
Remove-Item $accessTokenFilePath -Force -ErrorAction SilentlyContinue
Write-Verbose 'Cached Access Token has been erased.'
$NoTokenMsg = 'Access Token was empty/blank. '
} else {
$AccessToken = $Credential.GetNetworkCredential().Password
Write-Verbose "If the provided Access Token is valid and active, it will be cached."
$SaveNew = $true
}
} else {
if (-not $AccessToken) {
If (Test-Path $accessTokenFilePath) {
$content = Get-Content -Path $accessTokenFilePath -ErrorAction Ignore
if (-not [String]::IsNullOrEmpty($content)) {
$secureString = $content | ConvertTo-SecureString
Write-Verbose "Retrieving Access Token from cache file. This value can be cleared in the future using the 'Credential' switch and providing an empty password."
$accessTokenCredential = New-Object System.Management.Automation.PSCredential 'ignored', $secureString
$AccessToken = $accessTokenCredential.GetNetworkCredential().Password
} else {
$NoTokenMsg = "Access Token was empty/blank. "
}
} else {
$NoTokenMsg = "No cached Access Token found. "
}
}
}
if (-not $AccessToken) {
Write-Warning "$NoTokenMsg GitHub will limit queries to 60 per hour."
} else {
$headers.Authorization = "token $AccessToken"
}
$originalSecurityProtocol = [Net.ServicePointManager]::SecurityProtocol
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$IWRparams = @{
Uri = $LatestURL
Method = 'Get'
Headers = $headers
UseDefaultCredentials = $true
UseBasicParsing = $true
TimeoutSec = 0
}
Try {
$result = Invoke-WebRequest @IWRparams
} catch {
if ($_.Exception.Response.StatusCode.value__ -eq 404) {
Write-Warning "The URL, '$URL' does not appear to exist."
} elseif ($_.Exception.Response.StatusCode.value__ -eq 401) {
Write-Warning 'The provided access token is not authorized to access this repository.'
}
Throw $_.Exception.Message
} finally {
[Net.ServicePointManager]::SecurityProtocol = $originalSecurityProtocol
}
if ($SaveNew) {
# This comes after the query because only working tokens should be cached
If (-not (Test-Path $accessTokenFilePath)) { New-Item -Path $accessTokenFilePath -Force }
$Credential.Password | ConvertFrom-SecureString | Set-Content -Path $accessTokenFilePath -Force
}
if ($result.StatusCode -eq 202) {
Throw 'The server is busy right now. Please try again later.'
}
$finalResult = $result.Content | ConvertFrom-Json
$defaultDisplaySet = 'Name','Tag','AssetCount','Description'
#Create the default property display set
$defaultDisplayPropertySet = New-Object System.Management.Automation.PSPropertySet('DefaultDisplayPropertySet',[string[]]$defaultDisplaySet)
$PSStandardMembers = [Management.Automation.PSMemberInfo[]]@($defaultDisplayPropertySet)
$InfoObject = [pscustomobject]@{
Name = $finalResult.Name
Tag = $finalResult.tag_name | Select-Object -first 1
Description = $finalResult.body
TarballURL = "https://github.com/$ownerName/$repositoryName/archive/refs/tags/$($finalResult.tag_name | Select-Object -first 1).tar.gz"
ZipballURL = "https://github.com/$ownerName/$repositoryName/archive/refs/tags/$($finalResult.tag_name | Select-Object -first 1).zip"
AssetCount = $finalResult.assets.count
Assets = foreach ($item in $finalResult.assets) {
[PSCustomObject]@{
FileName = $item.name
CreationDate = get-date $item.created_at
Size = $item.size
DownloadURL = $item.Browser_download_url
SHA256 = $item.digest | Where-Object {$_ -match '^sha256:'} |
ForEach-Object {$_ -replace '^sha256:',''}
}
}
}
$InfoObject.PSObject.TypeNames.Insert(0,'Release.Information')
$InfoObject | Add-Member MemberSet PSStandardMembers $PSStandardMembers
$InfoObject
}
Set-Alias Get-LaRGH Get-LatestReleaseOnGitHub
Export-ModuleMember -Function Get-LatestReleaseOnGitHub -Alias Get-LaRGH
Log in or click on link to see number of positives.
- largh.0.2.0.nupkg (915ce4b75395) - ## / 67
In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).
Chocolatey Pro provides runtime protection from possible malware.
Add to Builder | Version | Downloads | Last Updated | Status |
---|---|---|---|---|
Latest Release on GitHub Helper 0.2.0 | 8 | Monday, July 7, 2025 | Ready | |
Latest Release on GitHub Helper 0.1.1 | 914 | Wednesday, July 31, 2024 | Approved | |
Latest Release on GitHub Helper 0.1 | 197 | Monday, October 17, 2022 | Approved |
Copyright 2022 Teknowledgist
CHANGE LOG:
- 0.1 - initial release
- 0.1.1 - fixed token storage bug
- 0.2 - added sha256 asset attribute
This package has no dependencies.
Ground Rules:
- This discussion is only about Latest Release on GitHub Helper and the Latest Release on GitHub Helper package. If you have feedback for Chocolatey, please contact the Google Group.
- This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
- The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
- Tell us what you love about the package or Latest Release on GitHub Helper, or tell us what needs improvement.
- Share your experiences with the package, or extra configuration or gotchas that you've found.
- If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.
teknowledgist (maintainer) on 07 Jul 2025 14:11:16 +00:00:
User 'teknowledgist' (maintainer) submitted package.
chocolatey-ops (reviewer) on 07 Jul 2025 14:47:04 +00:00:
largh has passed automated validation. It may have or may still fail other checks like testing (verification).
NOTE: No required changes that the validator checks have been flagged! It is appreciated if you fix other items, but only Requirements will hold up a package version from approval. A human review could still turn up issues a computer may not easily find.
Guidelines
Guidelines are strong suggestions that improve the quality of a package version. These are considered something to fix for next time to increase the quality of the package. Over time Guidelines can become Requirements. A package version can be approved without addressing Guideline comments but will reduce the quality of the package.
Notes
Notes typically flag things for both you and the reviewer to go over. Sometimes this is the use of things that may or may not be necessary given the constraints of what you are trying to do and/or are harder for automation to flag for other reasons. Items found in Notes might be Requirements depending on the context. A package version can be approved without addressing Note comments.
chocolatey-ops (reviewer) on 07 Jul 2025 14:52:38 +00:00:
largh has passed automated package testing (verification). The next step in the process is package scanning.
Please visit https://gist.github.com/choco-bot/ae43a4c5ec6f0a42ade19cac416e0981 for details.
This is an FYI only. There is no action you need to take.
chocolatey-ops (reviewer) on 07 Jul 2025 18:32:43 +00:00:
largh has passed automated virus scanning.