I have created a custom class in PowerShell which I would like to be able to access via the foreach command.
In PHP, I can do this by using implements iterator in my class declaration and implementing some variables and functions. Is there something similar in PowerShell? How do I let my PowerShell class be accessed by foreach?
Note: I'm using PowerShell Core
IEnumerableinterface.