我试图从平面文件源连接中获取字段列表。我尝试了以下powershell命令。
[xml]$p = cat .\package.dtsx
$p.Executable.ConnectionManager
它返回
Property ObjectData -------- ---------- {DelayValidation, ObjectName, DTSID, Description...} ObjectData {DelayValidation, ObjectName, DTSID, Description...} ObjectData {DelayValidation, ObjectName, DTSID, Description...} ObjectData {DelayValidation, ObjectName, DTSID, Description...} ObjectData {DelayValidation, ObjectName, DTSID, Description...} ObjectData {DelayValidation, ObjectName, DTSID, Description...} ObjectData {DelayValidation, ObjectName, DTSID, Description...} ObjectData ......
如何按名称查找特定连接?我试过以下但是它没有用。
# Find the connection which name is "XXX"
$p.Executable.ConnectionManager | % { $_.Property } | ? { $_.ObjectName -eq "XXX" }
答案 0 :(得分:0)
通过玩游戏,我找到了找到特定连接的方法。
$c = $p.Executable.ConnectionManager | ? { $_.Property[1]."#text" -eq "XXX" }
现在需要获取所有列。以下语句获取xml。
$c.ObjectData.ConnectionManager.OuterXml
但是,数据类型是整数。