Functions/Install-ToolFromUrl.ps1




function Install-ToolFromUrl {
    [CmdletBinding()]
    param ([string] $ToolPath
        , [string] $url
        , [string] $toolName
        )
    Write-Verbose "Getting file from url: $url"
    Write-Verbose "Saving file to path: $ToolPath"
    $Response = Get-FileFromUrl -ToolPath $ToolPath -url $url 
    if ($null -ne $Response){
        try{
        Expand-Archive -Path  $response.Filename -DestinationPath $ToolPath -Force -ea "stop"
        Save-MetaDataToFile (Get-MetaDataFile  $ToolPath) $response.Metadata
        }
        catch{throw}
    }
    Write-Host "$toolName installed"
}