Export Powershell 5 enum declaration from a Module
问题 I have an enum type defined within a module. How do I export it to be accessible from outside once the module has been loaded? enum fruits { apple pie } function new-fruit { Param( [fruits]$myfruit ) write-host $myfruit } My advanced function takes the enum instead of the ValidateSet which works if the enum is available, but fails if it isn't. Update: Separating it into a ps1 and dot-sourcing it (ScriptsToProcess) works, however I would wish that there's a cleaner way. 回答1: You can access the