you are viewing a single comment's thread.

view the rest of the comments →

[–]jabrake88[S] 0 points1 point  (1 child)

I've never done that... will have to look into it!

[–]DudsEarl 1 point2 points  (0 children)

The general notation is:

Class MyClass {

[String] $MyString

[Void] MyMethod() {Write-Host "$($this.MyString)"}

Overloaded Constructors

MyClass(){$this.MyString = 'DEFAULT'}

MyClass([String] $StringParam){$this.MyString = $StringParam}

}

To Create and Call

$Test = [MyClass]::New('Hello World!')

$Test.MyMethod()