'Using Classes within an class

Using other classes with a class in Powershell

I have a question about working with classes in powershell, how does one use one class within another? For example I have the class 'SomeClass', I would like to declare that within the other class in the example class below.

Pseudo Code:

class SomeClass {
    [string] $Status
    [string] $Reason
}

class SomeMasterClass {
    [string] $ServerName
    [string] $FileName
    [SomeClass] $TheClass   # is this correct?
}

I am curious of this is the correct way to go about it or is there a better way?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source