mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 03:57:32 +00:00
* Use Resolve-GithubReleaseAssetUrl more widely * Add the Get-ChecksumFromUrl function * Sort exported functions and add docs * Remove alias and fix typo * Fix kind checksum url and syntax * Fix checksums url for gh cli and msys2 * [Windows] Cleanup various scripts * Add spaces after type specifications * Rename the Take-Part function
31 lines
710 B
PowerShell
31 lines
710 B
PowerShell
function Get-LinkTarget {
|
|
param (
|
|
[string] $inputPath
|
|
)
|
|
$link = Get-Item $inputPath | Select-Object -ExpandProperty Target
|
|
if ($link) {
|
|
return " -> $link"
|
|
}
|
|
return ""
|
|
}
|
|
|
|
function Get-PathWithLink {
|
|
param (
|
|
[string] $inputPath
|
|
)
|
|
$link = Get-LinkTarget($inputPath)
|
|
return "${inputPath}${link}"
|
|
}
|
|
|
|
function Get-StringPart {
|
|
param (
|
|
[Parameter(ValueFromPipeline)]
|
|
[string] $toolOutput,
|
|
[string] $Delimiter = " ",
|
|
[int[]] $Part
|
|
)
|
|
$parts = $toolOutput.Split($Delimiter, [System.StringSplitOptions]::RemoveEmptyEntries)
|
|
$selectedParts = $parts[$Part]
|
|
return [string]::Join($Delimiter, $selectedParts)
|
|
}
|