Modules/businessdev.ALbuild.RuntimePackages/Private/Get-BcRuntimeFeedPackageId.ps1

function Get-BcRuntimeFeedPackageId {
    <#
    .SYNOPSIS
        The NuGet package id under which the runtime packages of one app VERSION are published.
 
    .DESCRIPTION
        The id carries the app version and the platform version is the package's own version, so one id
        holds every platform build of one released app version:
 
            365businessdevelopment.365businessBanking.runtime-18-3-531-27597
              -> versions 17.17.38111.0, 18.18.46920.0, ... 28.4.53241.0
 
        This reproduces the convention the pipeline has always used (`Get-RtRuntimePackageId`) letter for
        letter, and it must keep doing so: downloads.365businessdev.com and the blob retention guards
        both hang off these ids, so a change here is a change to a live contract, not a rename.
 
    .PARAMETER Publisher
        Publisher as app.json spells it; normalised for the id.
 
    .PARAMETER Name
        App name as app.json spells it; normalised for the id.
 
    .PARAMETER AppVersion
        The released app version. Dots become dashes - a dot would start a new id segment.
 
    .OUTPUTS
        System.String
    #>

    [CmdletBinding()]
    [OutputType([string])]
    param(
        [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $Publisher,
        [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $Name,
        [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $AppVersion
    )

    # Everything outside [A-Za-z0-9_-] goes, spaces included: '365 business development' becomes
    # '365businessdevelopment'.
    $norm = { param($v) ("$v" -replace '[^A-Za-z0-9_\-]', '') }
    return ('{0}.{1}.runtime-{2}' -f (& $norm $Publisher), (& $norm $Name), ("$AppVersion" -replace '\.', '-'))
}