Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rikwatson/bbd10cbd6cc27d06496d21736be025fd to your computer and use it in GitHub Desktop.
Save rikwatson/bbd10cbd6cc27d06496d21736be025fd to your computer and use it in GitHub Desktop.
Example of using `PSClass.ps1`
. ./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