You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Get-XeroxPrintAwarenessClient.ps1
# Define AppName
$AppName = "Xerox Print Awareness Client"
$ReleaseUrl = "https://www.support.xerox.com/en-us/product/xerox-print-awareness-tool/content/142452"
Write-Verbose "Obtaining $($AppName) Release Versions from $($ReleaseUrl)...`n"
# Main script to fetch and process links
$AppVersions = @(
@{AppName = $($AppName); Architecture = 'multi'; Type = 'zip'; Pattern = '*.zip'}
)
foreach ($AppVersion in $AppVersions) {
$SearchCount = 1 # This may need increasing as future versions are released
#Build each link with File Type specific versions
#URLs on this page are encoded, so need to decode to be readable
$DownloadLink = (((Invoke-WebRequest -Uri $ReleaseUrl).Links) | Where-Object {($_.href -like $($AppVersion.Pattern))}).href
$URL = [System.Net.WebUtility]::HtmlDecode($DownloadLink)
$Version = Get-Version -String $URL
do {
if ($URL) {
New-NevergreenApp -Name $($AppVersion.AppName) -Architecture $($AppVersion.Architecture) -Version $($Version) -Uri $($URL) -Type $($AppVersion.Type)
break
}
$SearchCount--
} until ($SearchCount -eq 0)
if ($SearchCount -eq 0) {
Write-Warning "Could not find release for $($AppName) $($AppVersion.Type)"
}
}
The text was updated successfully, but these errors were encountered:
@DanGough Wondering if there might be some benefit in enhancing Nevergreen so any encoded URLs are automatically Decoded to a human readable URL as I had to do on this script
...
#URLs on this page are encoded, so need to decode to be readable
$DownloadLink = (((Invoke-WebRequest -Uri $ReleaseUrl).Links) | Where-Object {($_.href -like $($AppVersion.Pattern))}).href
$URL = [System.Net.WebUtility]::HtmlDecode($DownloadLink)
...
This may mean a change needs to be made to the Uri logic on the New-NevergreenApp function 🤷♂️
Script:
The text was updated successfully, but these errors were encountered: