$localPfx = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$localPfx.Import(".\myCert.pfx", "password", "Exportable,PersistKeySet")
Я получил
Exception calling "Import" with "3" argument(s): "The system cannot find the file specified.
Если я использую
$PfxFileFull = Convert-Path .\myCert.pfx
или
$PfxFileFull = "D:\...\myCert.pfx" #full path
Затем запустите
$localPfx.Import($PfxFileFull, "password", "Exportable,PersistKeySet")
Тогда исключение исчезает.
Почему это происходит?