To retrieve the public key from a PFX certificate using Powershell, use the following command:
$publicKey = (Get-PfxCertificate -FilePath mycert.pfx).GetPublicKey()
To convert the public key to a hex string without hyphens you can use this command:
[System.BitConverter]::ToString($publicKey).Replace("-", "")