mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-24 10:28:10 +08:00
[ubuntu] Refactor Common.Helpers (#8910)
* [ubuntu] Refactor Common.Helpers * Move Get-AndroidPackages function from BeforeAll * Fix ParameterBinding
This commit is contained in:
committed by
GitHub
parent
92e22bd8c6
commit
0c03739e50
@@ -135,7 +135,7 @@ function Get-HomebrewVersion {
|
||||
}
|
||||
|
||||
function Get-CpanVersion {
|
||||
$result = Get-CommandResult "cpan --version" -ExpectExitCode @(25, 255)
|
||||
$result = Get-CommandResult "cpan --version" -ExpectedExitCode @(25, 255)
|
||||
$result.Output -match "version (?<version>\d+\.\d+) " | Out-Null
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
@@ -39,3 +39,16 @@ function Get-AptSourceRepository {
|
||||
$sourceUrl = Get-Content "$PSScriptRoot/../helpers/apt-sources.txt" | Select-String -Pattern $PackageName | Take-OutputPart -Part (1..3)
|
||||
return $sourceUrl
|
||||
}
|
||||
|
||||
function Get-OSVersionShort {
|
||||
$(Get-OSVersionFull) | Take-OutputPart -Delimiter '.' -Part 0,1
|
||||
}
|
||||
|
||||
function Get-OSVersionFull {
|
||||
lsb_release -ds | Take-OutputPart -Part 1, 2
|
||||
}
|
||||
|
||||
function Get-KernelVersion {
|
||||
$kernelVersion = uname -r
|
||||
return $kernelVersion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user