Created
April 1, 2019 08:16
-
-
Save rikwatson/bbd10cbd6cc27d06496d21736be025fd to your computer and use it in GitHub Desktop.
Example of using `PSClass.ps1`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. ./PSClass.ps1 | |
$name = @{` | |
FirstName = 'Rik' | |
LastName = 'Watson' | |
} | |
$object = New-Object -TypeName PSObject -Property $name | |
$object | Add-Member -MemberType ScriptProperty -Name FullName -Value {"$($this.FirstName) $($this.LastName)"} | |
$object | |
$fred = New-PSClass -ClassName fred {} | |
$fred.Is("fred") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment