Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Use last returned value of au_GetLatest instead of everything #28

Closed
@majkinetor

Description

People may accidentally return something else and it stops working. Example:

microsoftazurestorageexplorer

au_GetLatest failed
au_GetLatest doesn't return a HashTable result but System.Object[]

With this updater:

function global:au_GetLatest {
    $homepage_content = Invoke-WebRequest -UseBasicParsing -Uri $homepage

    # Get Version
    $homepage_content -match '(Version \d+.\d+.\d+)'     #<--------- OFFENDING LINE, RETURNS A VALUE
    $version = $matches[1] -replace "Version ", ""

    $Latest = @{ URL = $url; Version = $version }
    return $Latest
}

For this reason just take a last value returned and compalin if its not a [HashTable]

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions