umm...
This commit is contained in:
@@ -188,17 +188,10 @@ Function Download-File {
|
|||||||
)
|
)
|
||||||
$URI = Get-AbsoluteURI -URL $URL
|
$URI = Get-AbsoluteURI -URL $URL
|
||||||
If ( $null -eq $URI ) { Return }
|
If ( $null -eq $URI ) { Return }
|
||||||
If ( [string]::IsNullOrEmpty($File) ) { $File = '{0}{1}' -f (Get-TempPath), (Split-Path $URL -Leaf) }
|
If ( [string]::IsNullOrEmpty($File) ) { $File = '{0}{1}' -f (Get-TempPath), (Split-Path $URI -Leaf) }
|
||||||
If ( Test-Path $File ) {
|
|
||||||
#Write-Output "Deleting existing file: ""${File}"""
|
|
||||||
Try { Remove-Item $File -Force }
|
|
||||||
Catch { Write-Error $_.Exception.Message ; Return }
|
|
||||||
}
|
|
||||||
#Write-Output "Downloading ""${URI}"" to ""${File}"""
|
|
||||||
Try { (New-Object System.Net.WebClient).DownloadFile($URI,$File) }
|
Try { (New-Object System.Net.WebClient).DownloadFile($URI,$File) }
|
||||||
Catch { Write-Error $_.Exception.Message ; Return }
|
Catch { Write-Error $_.Exception.Message ; Return }
|
||||||
If ( Test-Path "${File}" ) { Return "${File}" }
|
Return $File
|
||||||
Else { Write-Output "Downloaded file does not exist at ""${File}""" ; Return }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install a program from a provided path
|
# Install a program from a provided path
|
||||||
|
|||||||
Reference in New Issue
Block a user