Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (29 sloc) 1.24 KB
function Get-RemoteElvUiVersion {
[cmdletbinding()]
param(
)
try {
$baseUrl = 'https://www.tukui.org'
$downloadPage = "$baseUrl/download.php?ui=elvui"
$dlString = '.+Download ElvUI.+'
Write-Verbose "Attempting to retrieve ElvUI information from [$downloadPage]..."
$downloadLink = "$baseUrl$(Invoke-WebRequest -Uri $downloadPage |
Select-Object -ExpandProperty Links |
Where-Object {
$_.Outerhtml -match $dlString
} |
Select-Object -ExpandProperty href)"
$fileName = $($downloadLink.Split('/')[4])
[double]$elvUiVersion = $fileName.Split('-')[1].Replace('.zip','')
$remoteElvInfo = [PSCustomObject]@{
FileName = $fileName
Version = $elvUiVersion
DownloadLink = $downloadLink
}
return $remoteElvInfo
}
catch {
$errorMessage = $_.Exception.Message
throw "Error getting remote ElvUI Information -> [$errorMessage]"
}
}