3
가져온 후에 내 모듈에서 내 보낸 변수를 검색하려면 어떻게합니까?모듈에서 내 보낸 변수를 검색하는 방법은 무엇입니까?
# in mymodule.psm1
$myVar = New-Object VarClass
#assume a function or two here.
Export-Modulemember -Function * -Variable *
# in myScript.ps1 after module import
# how do I reference this variable?
$myScriptVar = $myVar
죄송합니다.이 간단한 문제에 대한 예제는 찾을 수 없습니다.
'-Variable * '이 실제로 작동하는지 모르겠습니다. 그것은 모든 자동 변수로 위험 할 수 있습니다. '-Variable myVar'을 시도해 주시겠습니까? – briantist
'Export-Modulemember -Function myFunc -Variable myVar' – TacoMaster6000
흠과 함께 이미 시도해 보았습니다. 흥미 롭습니다. 어쩌면이게다고 생각합니다. http://stackoverflow.com/q/8001496/3905079 – briantist