Files
qmi-cloud-tf-modules/replicate-install/scripts/di-replicate-getBinary.ps1
Manuel Romero 4f496bf8fd less logs
2021-05-06 09:58:04 +02:00

43 lines
1.2 KiB
PowerShell

<#
Module: di-replicate-getBinary
Author: Vincenzo Esposito
Modified by: -
Modification History:
- Started from qs-getBinary
last updated: 20/04/2020
Intent: Download the Attunity binary selected by the end user of QMI.
Download collaterals binary (.NET and DB)
#>
Param(
[string] $url
)
$ProgressPreference = 'SilentlyContinue'
$bin = "$PSScriptRoot\binaries"
New-Item -ItemType Directory -Force -Path $bin | Out-Null
$path = join-path $bin Attunity
$fileName = $url.Substring($url.LastIndexOf("/") + 1)
if ( -Not (Test-Path $path\$fileName))
{
Write-Host "Binary not found for $($fileName), downloading..."
if ( -Not (Test-Path $path))
{
New-Item -ItemType directory -Path $path -ea Stop | Out-Null
}
$dlLoc = join-path $path $fileName
Write-Host "Downloading '$fileName' from $url into $dlLoc"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
(New-Object System.Net.WebClient).DownloadFile($url, $dlLoc)
}
else {
Write-Host "Binary found for $($fileName)"
}