There's a possibility to create and use .NetFramework class in PowerShell via cmdlet "Add-Type". You should use New-Object cmdlet to instantiate objects.

The code below is an example to initialize Class "CarCL" and to create 2 objects of this class - $box and $car.


If you don't use construction like ' if (-not ([System.Management.Automation.PSTypeName]'CarCL').Type)', you can get the warning on the non-first execution of PowerShell Script.

Add-Type : Cannot add type. The type name 'CarCL' already exists.