Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New App Request] Allround Automations PL/SQL Developer (On Proposals list) #91

Open
AScott-WWF opened this issue Jul 2, 2024 · 0 comments

Comments

@AScott-WWF
Copy link

N.B. This is a paid product, so this will download the 'free-trial' which I believe becomes a full product with a valid licence key.

Script:

# Get-AllroundAutomationsPLSQLDeveloper.ps1

# Define AppName
$AppName = "Allround Automations PL/SQL Developer"

$ReleaseUrl = "https://www.allroundautomations.com/products/pl-sql-developer/free-trial/"

Write-Verbose "Obtaining $($AppName) Release Versions from $($ReleaseUrl)...`n"

# Fetch the HTML content from the specified URL
$htmlContent = (Invoke-WebRequest -Uri $ReleaseUrl -UseBasicParsing).Content

# Define the RegEx pattern to match the URLs within the option value attributes
$regexPattern = '<option value="(https://www\.allroundautomations\.com/files/trial/[^"]+\.msi)">'

# Find all matches in the HTML content
$releases = [regex]::Matches($htmlContent, $regexPattern)

# Extract the URLs and match them to the appropriate architecture
$x64url = $releases | ForEach-Object { $_.Groups[1].Value } | Where-Object { $_ -match 'x64' }
$x86url = $releases | ForEach-Object { $_.Groups[1].Value } | Where-Object { $_ -match 'x32' }

# Main script to fetch and process links
$AppVersions = @(
    @{AppName = "$($AppName) Trial"; Architecture = 'x64'; Type = 'msi'; Pattern = $($x64url); VersionPattern = '>Version (\d+\.\d+\.\d+)</span>'}
    @{AppName = "$($AppName) Trial"; Architecture = 'x86'; Type = 'msi'; Pattern = $($x86url); VersionPattern = '>Version (\d+\.\d+\.\d+)</span>'}
)

foreach ($AppVersion in $AppVersions) {
    $SearchCount = 1 # This may need increasing as future versions are released

    #Build each link with File Type specific versions
    $URL = $($AppVersion.Pattern)
    [version]$Version = Get-Version -Uri $ReleaseUrl -Pattern $AppVersion.VersionPattern
    
    do {
        if ($URL) {
            New-NevergreenApp -Name $($AppVersion.AppName) -Version $($Version) -Uri $($URL) -Architecture $($AppVersion.Architecture) -Type $($AppVersion.Type)
            break
        }

        $SearchCount--
    } until ($SearchCount -eq 0)

    if ($SearchCount -eq 0) {
        Write-Warning "Could not find release for $($AppName) $($AppVersion.Type)"
    }
}

$ReleaseNotesUrl = "https://www.allroundautomations.com/products/pl-sql-developer/release-notes/"
Write-Verbose "$($AppName) Release notes are available here: $($ReleaseNotesUrl)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant