Skip to content

Instantly share code, notes, and snippets.

@SteveL-MSFT
Created January 26, 2019 02:32
Show Gist options
  • Save SteveL-MSFT/ca15f1c734c9c8ddcc9259c163be97bf to your computer and use it in GitHub Desktop.
Save SteveL-MSFT/ca15f1c734c9c8ddcc9259c163be97bf to your computer and use it in GitHub Desktop.
Access class inside script module
@"
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