Helper/Download-Extension.ps1
function Download-Extension { param ( [Parameter(Position=0, Mandatory=$true)] [String]$ExtPublisher= 'Bricklead', [Parameter(Position=1, Mandatory=$true)] [string]$ExtName, [Parameter(Position=2)] [string]$ExtVersion = 'latest', [Parameter(Position=3)] [string]$ExtBranch = 'release-candidate', [Parameter(Position=4, Mandatory=$true)] [string]$DestinationFolder ) $AppURL = Get-ExtensionURL $ExtPublisher $ExtName $ExtVersion $ExtBranch $TempZip = "$env:TEMP\$([Guid]::newguid().ToString()).zip" Get-File -SourceURL $AppURL -destinationFile $TempZip try { Get-File -SourceURL $AppURL -destinationFile $TempZip Expand-File -Source $TempZip -Destination $DestinationFolder } finally { Remove-Item $TempZip -Force -ErrorAction SilentlyContinue } } Export-ModuleMember -Function Download-Extension |