[ubuntu] Refactor Common.Helpers (#8910)

* [ubuntu] Refactor Common.Helpers

* Move Get-AndroidPackages function from BeforeAll

* Fix ParameterBinding
This commit is contained in:
Shamil Mubarakshin
2023-11-30 10:23:27 +01:00
committed by GitHub
parent 92e22bd8c6
commit 0c03739e50
5 changed files with 156 additions and 65 deletions

View File

@@ -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
}