Given this Powershell SMO method call...
where $_cert is a Microsoft.SqlServer.Management.Smo.Certificate object and the arguments are plain strings (not secure strings).
When I execute the code it returns a FailedOperationError. I can't figure out why it is failing. I have tested all the paths in the script to ensure it has access. I've written test files from within the script to ensure it is not a permissions issue. Information in the exception has been no help. I'm frustrated and would appreciate any help figuring this out.
I can hear someone thinking "why don't you just use t-sql to backup the certificates?" I prefer the flexibility of executing the script from a central location and not needing to give the SQL service account to some file share.