Containers/Get-VSCodeExtensionFromContainer.ps1

<#
 .Synopsis
  Downloads the VS Code AL extension from the container
 .Description
  Downloads the VS Code AL extension from the container
 .Parameter ContainerName
  Name of the container. Can be provided in the settings.json
 .Parameter SourcePath
  Path to the current project
 .Example
  Get-VSCodeExtensionFromContainer
#>

function Get-VSCodeExtensionFromContainer {
    Param(
        [Parameter(Mandatory=$false)]
        [string]$ContainerName = (Get-ContainerFromLaunchJson),
        [ParameteR(Mandatory=$false)]
        [string] $sourcePath = (Get-Location)
    )

    $Logs = docker logs $ContainerName
    $VsixUrl = $Logs.item($Logs.indexOf('Files:') + 1)
    $VsixName = (Split-Path $VsixUrl -Leaf).TrimEnd('.vsix')
    $VsixPath = Join-Path $sourcePath $VsixName
    $VsixFile = (Join-Path -Path $VsixPath -ChildPath $VsixName) + '.vsix'
    if (!(Test-Path $VsixPath)){
        New-Item -Path $VsixPath -ItemType Directory | Out-Null
        Download-File -sourceUrl $VsixUrl -destinationFile $VsixFile
    }

    $VsixFile
}

Export-ModuleMember -Function Get-VSCodeExtensionFromContainer