Session

Intelligent data objects in PowerShell - A first step towards object-oriented programming

Data objects of the general class PSCustomObject are a good and frequently used option for storing data that belongs together in a data structure or variable. What is less well known is that functionality can also be added to these objects using the Add-Member command. The ScriptProperty type can be used to create dynamic properties, for example a FullName property as a combination of the FirstName and LastName properties. The ScriptMethod type can be used to implement complex methods that write the object's data to a file, for example. In the talk, I will show how this can reduce the code in the main program and focus on the essentials. This approach is particularly suitable for smaller projects or projects under construction, where the use of real custom classes should be avoided initially or in general.

Andreas Jordan

Principal Consultant at ORDIX AG

Wiesbaden, Germany

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top