function Find-NewMessages($valvar1, [REF]$refvar1, [REF]$refvar2) { 
//some stuff
$refvar1.Value = “hi” #注意,此处一定要是$refvar1.Value,而不能直接用$refvar1
$refvar2.Value = “bye”
}


然后在调用时
$refvar1 = “1”
$refvar2  “2”
Find-NewMessages $valvar1 ([REF]$refvar1) ([REF]$refvar2)
//now $refvar1 = “hi” and $refvar2 = “bye”

posted on 2011-09-09 00:30  英雄小强  阅读(592)  评论(0编辑  收藏  举报