I am on my way to create a custom powershell module for one of our recovery products. Currently it is been developed with the help of powershell functions. I am thinking of experimenting the same with the help of PowerShell class and object constructs, but i am not sure if i should do it all or not.
Please help me to understand following-
Should we create PowerShell module with the help of Class and Object?
If Yes, Than Why?
what are the benefits of having Class and Objects compare to PowerShell functions?
Does it help us in creating custom Object types efficiently and manage the objects in effective way?
if not, then what are the drawbacks of having module written as Class and object compare to Function.
It is not mandatory to write PowerShell classes to create the modules, it is completely up to you. But PowerShell modules will not export the classes, you need to create an object for that class in the module itself and export it using functions.
-
You can create custom type objects with your own members (Properties, Methods & etc.,)