public PSADCredential CreateSpPasswordCredential(string spObjectId, PasswordCredential credential) { ValidatePasswordCredential(credential); var passwordCredsList = GetSpPasswordCredentials(spObjectId); // Add new PasswordCredential to existing KeyCredential list passwordCredsList.Add(credential); PatchSpPasswordCredentials(spObjectId, passwordCredsList); return(credential.ToPSADCredential()); }