functions/certificates/Get-CertificateFriendlyName.ps1

function Get-CertificateFriendlyName {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string]$Thumbprint,

        [Parameter(Mandatory = $false)]
        $StorePath = 'LocalMachine\My'
    )

    $certPath = Join-Path -Path 'Cert:\' -ChildPath $StorePath

    try {
        return (Get-ChildItem -Path $certPath | Where-Object { $_.Thumbprint -eq $Thumbprint }).FriendlyName
    }
    catch {
        Write-Error "Unable to find certificate $($Thumbprint) in $($certPath)!"
        return $false
    }    
}