Last active
November 24, 2015 00:49
-
-
Save Jaykul/23c3e2e0d2af46f08b64 to your computer and use it in GitHub Desktop.
PowerShell 5 Classes (v 10586)
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
PS> mkdir ClassContainer | |
Directory: C:\Users\Joel\Documents\WindowsPowerShell\TestData\modules | |
Mode LastWriteTime Length Name | |
---- ------------- ------ ---- | |
d----- 11/23/2015 7:41 PM ClassContainer | |
PS> cd .\ClassContainer\ | |
PS> 'class FooMatic { [string]$Name = "Joel" }' > ClassContainer.psm1 | |
PS> cd .. | |
PS> $Env:PSModulePath += ";$pwd" | |
PS> 'using module classcontainer | |
· [FooMatic]::New() ' > test.ps1 | |
PS> .\test.ps1 | |
Name | |
---- | |
Joel | |
PS> using module classcontainer | |
PS> [FooMatic]::New() | |
Name | |
---- | |
Joel | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment