ReadOnlyDictionary is difficult to construct in Powershell and may be an intimidating barrier to extension authors not fluent with C# (see https://github.com/PowerShell/SecretManagement/issues/108 for potential remediation on this point)
Further, ReadOnlyDictionary is case sensitive by default, which powershell users are normally not used to for property names. They would expect $secret.metadata.test and $secret.metadata.Test to return the same data, whereas currently only one will and one won't with ReadOnlyDictionary unless it was constructed with the correct stringcomparer
However, accepting an ordered in the secretinformation constructor makes it easy on extension authors who can just supply a hashtable or an ordered hashtable, and then secretmanagement can store/present with the AsReadOnly() method to get the same effect as a readonlydictionary using a non-generic type but one that is effectively string,object anyways.
Alternatively, the dictionary can be instantiated with StringComparer.OrdinalIgnoreCase, but this would require the extension author to implement correctly when supplying it to secretmanagement, leading to inconsistent user experience.
ReadOnlyDictionary is difficult to construct in Powershell and may be an intimidating barrier to extension authors not fluent with C# (see https://github.com/PowerShell/SecretManagement/issues/108 for potential remediation on this point)
Further, ReadOnlyDictionary is case sensitive by default, which powershell users are normally not used to for property names. They would expect $secret.metadata.test and $secret.metadata.Test to return the same data, whereas currently only one will and one won't with ReadOnlyDictionary unless it was constructed with the correct stringcomparer
However, accepting an
ordered
in thesecretinformation
constructor makes it easy on extension authors who can just supply a hashtable or an ordered hashtable, and then secretmanagement can store/present with theAsReadOnly()
method to get the same effect as a readonlydictionary using a non-generic type but one that is effectivelystring,object
anyways.Alternatively, the dictionary can be instantiated with
StringComparer.OrdinalIgnoreCase
, but this would require the extension author to implement correctly when supplying it to secretmanagement, leading to inconsistent user experience.