I try to execute the following command in console:
powershell.exe -NoLogo -Command `"Get-ChildItem "Cert:\CurrentUser\My" | WHERE{$_.Extensions['Certificate Template Name'] -match 'CA'}`"
I need to execute this command in CMD, not ps1 script.
There was in issue with your double quotes.
I've changed it slightly:
powershell.exe -NoLogo -Command "Get-ChildItem Cert:\CurrentUser\My | where {$_.Extensions['Certificate Template Name'] -match 'CA'}"