Created
January 26, 2019 02:32
-
-
Save SteveL-MSFT/ca15f1c734c9c8ddcc9259c163be97bf to your computer and use it in GitHub Desktop.
Access class inside script module
This file contains hidden or 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
@" | |
class foo | |
{ | |
[string] static bar([string] $text) | |
{ | |
return $text | |
} | |
} | |
"@ > class.psm1 | |
import-module ./class.psm1 | |
$m = get-module class | |
. $m { [foo]::bar('hello') } | |
$text = "bye" | |
. $m { param($string) [foo]::bar($string) } ( $text ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment