Private/Format-AzTableEntityResource.ps1

function Format-AzTableEntityResource {
    <#
    .SYNOPSIS
        Builds an Azure Table Storage entity resource path with URI-escaped keys.
    #>

    [CmdletBinding()]
    param (
        [Parameter(Mandatory)]
        [ValidateNotNullOrEmpty()]
        [string]$TableName,

        [Parameter(Mandatory)]
        [ValidateNotNullOrEmpty()]
        [string]$PartitionKey,

        [Parameter(Mandatory)]
        [ValidateNotNullOrEmpty()]
        [string]$RowKey
    )

    $encodedPartitionKey = [Uri]::EscapeDataString($PartitionKey)
    $encodedRowKey = [Uri]::EscapeDataString($RowKey)
    return "${TableName}(PartitionKey='${encodedPartitionKey}',RowKey='${encodedRowKey}')"
}