AL/Get-RuntimePackage.ps1
function Get-RuntimePackage { param ( [Parameter(Mandatory=$false)] [string] $ContainerName, [Parameter(Mandatory=$false)] [string] $SourceFolder = (Get-Location), [Parameter(Mandatory=$true)] [string] $outputFolder, [Parameter(Mandatory=$true)] [securestring] $pfxFile, [Parameter(Mandatory=$true)] [securestring] $pfxPassword, [switch] $TestApp ) if ($null -eq $ContainerName -or $ContainerName -eq "") { $ContainerName = (Get-EnvironmentKeyValue -KeyName 'name') } if (!(Test-Path $outputFolder)) { New-EmptyDirectory $outputFolder } $appJson = (Get-Content (Join-Path $SourceFolder 'app.json') -Raw | ConvertFrom-Json) $localPath = Join-Path $outputFolder ($appJson.Publisher +"_" + $appJson.Name + "_" + $appJson.Version + "_Runtime.app") $appFile = Get-NavContainerAppRuntimePackage -containerName $ContainerName -appName $appJson.name Copy-FileFromBCContainer -containerName $ContainerName -containerPath $appFile -localPath $localPath Invoke-SignFile -FilenAme $localPath -pfxFile $pfxFile -pfxPassword $pfxPassword if ($TestApp.IsPresent) { $localPath = Join-Path $outputFolder ($appJson.Publisher + "_" + $appJson.Name + " Tests_" + $appJson.Version + "_Runtime.app") $appFile = Get-NavContainerAppRuntimePackage $ContainerName -appName "$($appJson.name + ' Tests')" Copy-FileFromBCContainer -containerName $ContainerName -containerPath $appFile -localPath $localPath Invoke-SignFile -FilenAme $localPath -pfxFile $pfxFile -pfxPassword $pfxPassword } } Export-ModuleMember Get-RuntimePackage |