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] LastPass (On To Do List) #103

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

[New App Request] LastPass (On To Do List) #103

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

Comments

@AScott-WWF
Copy link

Script:

# Get-LastPass.ps1

# Define AppName
$AppName = "LastPass"

$ReleaseUrl = "https://lastpass.com/misc_download2.php"
$InstallInstructionsUrl = "https://support.lastpass.com/s/document-item?language=en_US&bundleId=lastpass&topicId=LastPass/Download_and_Install_LastPass.html&_LANG=enus"

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

# Main script to fetch and process links
$AppVersions = @(
        @{AppName = "$($AppName) Universal Windows Installer"; Type = 'exe'; Pattern = '\.exe'; ; VersionPattern = '(?s)<h4>LastPass Universal Windows Installer</h4>.*?href="[^"].*?LastPassInstaller\.exe".*?>.*?>Version (\d+\.\d+\.\d+)'}
)

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

    #Build each link with File Type specific versions
    $URL = (Get-Link -Uri $ReleaseUrl -MatchProperty href -Pattern $AppVersion.Pattern)
    #[version]
	$Version = Get-Version -Uri $ReleaseUrl -Pattern $AppVersion.VersionPattern

    $ReleaseNotesUrl = "https://lastpass.com/releasenotes.php"
    Write-Verbose "$($AppName) (Version: $($Version)) Release notes are available here: $($ReleaseNotesUrl)"
    
    do {
        if ($URL) {
            New-NevergreenApp -Name $($AppVersion.AppName) -Version $($Version) -Uri $($URL) -Architecture 'multi' -Type $($AppVersion.Type)
            break
        }

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

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

Write-Verbose "$($AppName) Install instructions are available here: $($InstallInstructionsUrl)"
@AScott-WWF AScott-WWF changed the title [New App Request] LastPass (On Proposals List) [New App Request] LastPass (On To Do List) Jul 2, 2024
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