AL/Get-ALDependency.ps1

<#
 .Synopsis
  Retrieves all dependencies for the current project
 .Description
  If the current project is dependent on other apps, it will attempt to retrieve those dependencies.
 .Parameter SourcePath
  Path to the current project
 .Parameter devOpsToken
  Token to access Azure DevOps. Can be provided in settings.json
 .Parameter ContainerName
  If blank, the container name will be retrieved from settings.json
 .Parameter skipVerification
  Add this switch to skip app verification for dependency apps
 .Parameter Install
  Add this switch to install the dependency apps
 .Parameter TenantScope
  Add this switch to install the dependency apps in the tenant and not global scope
 .Example
  $dependencies = Get-ALDependency
 .Example
  $dependencies = Get-ALDependency -SourcePath "C:\Temp" -skipVerificatio
#>

function Get-ALDependency {
    param (
        [Parameter(Mandatory = $false)]
        [string] $SourcePath = (Get-Location),
        [Parameter(Mandatory = $false)]
        [string] $devOpsToken = "",
        [Parameter(Mandatory = $false)]
        [string] $ContainerName = "",
        [switch] $skipVerification,
        [switch] $Install,
        [switch] $TenantScope
    )

    $dependencyPath = (Join-Path $SourcePath "tempDependency")
    $ContainerName = Get-NewContainerName -SourcePath $SourcePath -ContainerName $ContainerName

    if ($devOpsToken -eq "") {
        $devOpsToken = Get-DevOpsToken -SourcePath $SourcePath
    }

    if (!(Test-Path (Join-Path $dependencyPath ".alpackages") -PathType Container)) {
        New-Item -Path $dependencyPath -Name ".alpackages" -ItemType Directory | out-Null
    }

    $appJson = (Get-Content (Join-Path $SourcePath "app.json") | ConvertFrom-Json)
    # currently, set this to true, since it seems that the latest docker image does not have the apps codesigned.
    if ($skipVerification.IsPresent) {}
    Get-ALDependenciesFromAppJson -appJson $appJson -sourcePath $SourcePath -dependencyPath $dependencyPath -containerName $containerName -skipVerification -Install:$Install -TenantScope:$TenantScope -devOpsToken $devOpsToken
}
Export-ModuleMember Get-ALDependency