PowerShell_Scripts/git/Get-GitHubReleaseTag.ps1

12 lines
355 B
PowerShell
Raw Normal View History

[CmdletBinding()]param(
[Parameter(Mandatory)]
[string]$GitHubProject,
[string]$tag='latest'
)
Invoke-WebRequest https://github.com/$GitHubProject/releases/$tag -ErrorAction Stop |
Select-Object -ExpandProperty Links |
Where-Object title |
Where-Object href -match 'tree/[^/]+$' |
Select-Object -ExpandProperty title -First 1