Daniel has provided the solution:
[System.Collections.Generic.Dictionary`2+Enumerator[string, int]]
returns the type of interest (note that the nested [...]
around the individual generic type arguments, string
and int
, are optional).
That is, before being able to specify type arguments in order to construct a generic type, you must first specify its open form, which requires specifying the generic arity (the count of type arguments, <n>
) in the form `<n>
following the type name, namely `2
in the case of System.Collections.Generic.Dictionary<TKey,TValue>
(expressed in C# notation), using the language-agnostic .NET API notation, as explained in this answer.
- If no nested type (suffixed with
+<typename>
) is involved, specifying the arity is optional if all type arguments are specified; e.g., instead of [System.Collections.Generic.Dictionary`2[string, int]]
, [System.Collections.Generic.Dictionary[string, int]]
is sufficient.
However, the enumerator type in question has no public constructor, so you cannot instantiate it directly; rather, it is the type returned when you call .GetEnumerator()
on (a constructed form of) the enclosing type, [System.Collections.Generic.Dictionary`2]
; verify with:
Get-Member -InputObject ([System.Collections.Generic.Dictionary[string, int]])::new().GetEnumerator()