fusionpbx-install.sh/windows/resources/get-file.ps1

13 lines
396 B
PowerShell

# Download file to current folder using default or provided name. Return saved file name
Function Get-File([string]$url, [string]$filename) {
#Get filename from path
if ($filename.Length -eq 0) {
$filename = Split-Path -Path $url -Leaf
}
#Download if local copy doesn't exist
if (-not (Test-Path $filename)) {
Invoke-WebRequest $url -OutFile $filename
}
return $filename
}