Deprecated/Get-FreedomScientificJAWS.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$MajorVersion = 20

do {
    try {

        $Releases = Invoke-RestMethod -Uri "https://support.freedomscientific.com/Downloads/OfflineInstallers/GetInstallers?product=JAWS&version=$MajorVersion&language=mul&releaseType=Offline" -DisableKeepAlive

        foreach ($Release in $Releases) {

            if ($Release.InstallerPlatform -eq '32-bit') {
                $Architecture = 'x86'
            }
            elseif ($Release.InstallerPlatform -eq '64-bit') {
                $Architecture = 'x64'
            }
            else{
                Write-Warning "Unrecognised platform: $($Release.InstallerPlatform)"
                break
            }

            $Version = $Release.FileName | Get-Version
            $Type = (Get-Culture).TextInfo.ToTitleCase([System.IO.Path]::GetExtension($Release.InstallerLocationHTTP).Replace('.',''))
            New-NevergreenApp -Name 'JAWS' -Version $Version -Uri $Release.InstallerLocationHTTP -Architecture $Architecture -Type $Type
        }

    }
    catch {
        Write-Error "$($MyInvocation.MyCommand): $($_.Exception.Message)"
    }

    $MajorVersion++

}
until ($MajorVersion -ge ([int](Get-Date -Format 'yy') + 1) -and $Releases.Count -eq 0)