Welcome to Microsoft Q&A Platform.
Can you try using the cmdlet "Get-ChildItem"?, for example:
Get-ChildItem -path cert:\LocalMachine\My | Select-Object NotAfter, Subject
For reference: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/about/about_certificate_provider?view=powershell-7.2
I hope this helps!
----------
Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.