Build/Get-AppFromFTP.ps1
function Get-AppFromFTP{ param ( [Parameter(Mandatory=$true)] [String]$AppName, [Parameter(Mandatory=$true)] [version]$PlatformVersion ) $folderName = 'Business Central ' + $PlatformVersion.Major; $appFiles = Get-ChildItemFTP $folderName $artifactPath = Create-TempDirectory foreach ($appFile in $appFiles) { if ($appFile.contains($AppName)) { Get-ItemFTP -FTPPath $folderName -Name $appFile -LocalPath $artifactPath Get-ChildItem -Path $artifactPath } } Remove-Item $artifactPath -Recurse } Export-ModuleMember -Function Get-AppFromFTP |