Every resource I've found so far, such as this question, boils down to:
- Get the certificate as an X509Certificate2
- Cast the PrivateKey property to RSACryptoServiceProvider
- Do stuff involving CspKeyContainerInfo property on the private key
This works in PowerShell 5, but in PowerShell 7, the PrivateKey property is an RSACng, not an RSACryptoServiceProvider, and so step 2 doesn't work.