Private/Install/Get-PWSHYBKPIVDownloadUrl.ps1
|
function Get-PWSHYBKPIVDownloadUrl { <# .SYNOPSIS Builds the yubico-piv-tool MSI download URL from the configured template. .DESCRIPTION Substitutes the {version} and {arch} tokens in installation.urlTemplate with the configured version and the resolved architecture. .PARAMETER Installation The Config.installation section, as returned by Read-PWSHYBKPIVConfigFile. .PARAMETER Architecture "win32" or "win64", as returned by Resolve-PWSHYBKPIVArchitecture. .OUTPUTS String. The MSI download URL. .EXAMPLE Get-PWSHYBKPIVDownloadUrl -Installation $config.installation -Architecture 'win64' Returns 'https://developers.yubico.com/yubico-piv-tool/Releases/yubico-piv-tool-2.7.3-win64.msi'. #> [CmdletBinding()] [OutputType([string])] param( [Parameter(Mandatory)] [PSCustomObject] $Installation, [Parameter(Mandatory)] [ValidateSet('win32', 'win64')] [string] $Architecture ) $Installation.urlTemplate.Replace('{version}', $Installation.version).Replace('{arch}', $Architecture) } |