PowerShell takes advantage of the underlying .Net framework, using objects instead of text.
Objects in .Net are much the same except for two small differences: the â€œPartsâ€ are called properties and the â€œInstructionsâ€ are called methods. If we wanted to represent a Windows Service as an object.
Creating PowerShell custom objects is a common task that someone find hard to do. I will show you a sample code to create custom objects.
Creating Custom Objects Using Add-Member
First, let's use Add-Member to create our objects.
$obj | Add-Member Noteproperty -Name Name -value "Van Don"
$obj | Add-Member Noteproperty -Name Title -value "PowerShell Tutorial"