【发布时间】:2016-09-27 18:20:50
【问题描述】:
我需要处理从这个函数返回的对象吗?我没有在 PSObject 上看到 Dispose 方法,但这并不一定意味着该对象不能/不应该被处置。我搜索了谷歌,找不到与处理 PSObject 对象相关的任何内容。
function MakeDBConnectInfoObject(
[string] $DBDestServer,
[string] $DBDestDB,
[string] $DBDestUserName,
[string] $DBDestPassword
) {
$DBConnectInfo = new-object -typename psobject -property @{
DBDestServer = $DBDestServer
DBDestDB = $DBDestDB
DBDestUserName = $DBDestUserName
DBDestPassword = $DBDestPassword
}
return $DBConnectInfo
}
【问题讨论】:
标签: powershell powershell-2.0 dispose idisposable psobject