protected override void ProcessRecord()
        {
            if (null != AlwaysEncryptedManagement.CustomProviders)
            {
                AlwaysEncryptedManagement.CustomProviders.Add(this.ProviderName, this.Provider);
            }

            //retrieve the provider name we want to register.
            //don't know why Microsoft use a static field for their provider name (i.e. SqlColumnEncryptionCertificateStoreProvider.ProviderName)
            //especially because the base class SqlColumnEncryptionKeyStoreProvider doesn't provide an abstract static field ProviderName.
            //to keep consistent with their implementation, i use also a static field.
            //the JDBC driver use a non-static field.
            var providerName = string.Empty;
            {
                var providerType = Provider.GetType();
                providerName = (string)providerType.GetField("ProviderName", BindingFlags.Static | BindingFlags.Public)
                               .GetValue(providerType);
            }

            //register the custom provider in SqlConnection class
            var sqlColumnCustomProviders = SqlConnectionExtension.GetCustomKeyStoreProvider();

            if (null != sqlColumnCustomProviders)
            {
                sqlColumnCustomProviders.Add(providerName, Provider);
            }

            //write back the dictionnary to field
            SqlConnectionExtension.SetCustomKeyStoreProvider(sqlColumnCustomProviders);
        }
 protected override void ProcessRecord()
 {
     if (FromSQLConnection.IsPresent)
     {
         var customProviders = SqlConnectionExtension.GetCustomKeyStoreProvider();
         WriteObject(
             new Dictionary <String, SqlColumnEncryptionKeyStoreProvider>(customProviders)
             );
     }
     else
     {
         WriteObject(
             new Dictionary <String, SqlColumnEncryptionKeyStoreProvider>(AlwaysEncryptedManagement.CustomProviders)
             );
     }
 }