I have a module where I define enumerators. Currently, I have the enumerator definitions in a ps1
file, which I dot-source in the psm1
module file, like this:
Enumerators.ps1
enum Fruits {
apple
pear
orange
banana
}
MyModule.psm1
. Fruits.ps1
I was doing the same with classes, but I learned about the Types.ps1xml
file for defining types, so I'll be moving my class definitions into there. Is there a comparable method for defining enumerators? Microsoft's documentation doesn't mention an "enumerator" member tag for Types.ps1xml
.
I found this question, which is from PS v5--I'm wondering if something's changed with PS6/7?