Misc/Get-FileFromStorage.ps1
function Get-FileFromStorage { Param( [Parameter(Mandatory=$true)] [string] $fileName ) if ($fileName.StartsWith("https://") -or $fileName.StartsWith("http://")) { $fileNameUrl = $fileName $tempFilename = New-TemporaryFile Write-Host "Downloading file '$fileNameUrl'" (New-Object System.Net.WebClient).DownloadFile($fileNameUrl, $tempFilename) } $tempFilename } Export-ModuleMember Get-FileFromStorage |