mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 20:56:47 +00:00
30 lines
704 B
PowerShell
30 lines
704 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 Take-Part {
|
|
param (
|
|
[Parameter(ValueFromPipeline)]
|
|
[string] $toolOutput,
|
|
[string] $Delimiter = " ",
|
|
[int[]] $Part
|
|
)
|
|
$parts = $toolOutput.Split($Delimiter, [System.StringSplitOptions]::RemoveEmptyEntries)
|
|
$selectedParts = $parts[$Part]
|
|
return [string]::Join($Delimiter, $selectedParts)
|
|
} |