如何使用 PowerShell 从 SSIS 包文件中提取值? [英] How do I extract a value from SSIS package file using PowerShell?

查看:49
本文介绍了如何使用 PowerShell 从 SSIS 包文件中提取值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sql Server 集成服务包存储为带有 dtsx 扩展名的 xml 文件.我需要能够使用 Powershell 提取他们的内部版本号.文件顶部的相关部分看起来像-

Sql Server Integration Services packages are stored as xml files with a dtsx extension. I need to be able to extract their build numbers with Powershell. The relevant part at the top of the file looks like-




<DTS:Property DTS:Name="PackageFormatVersion">2</DTS:Property>
1
0
265

我需要提取 VersionBuild 编号,但 DTS 命名空间让我感到困惑.获取内容后,如何获取值?

I need to extract the VersionBuild number, but the DTS namespace is confusing me. After I do the get-content, how can I get at the value?

推荐答案

作为 SQL Server Powershell 扩展的一部分CodePlex 项目有一个 SSIS 模块.你可以在哪里做这样的事情:

As part of SQL Server Powershell Extensions CodePlex project there an SSIS module. Where you can do something like this:

import-module SSIS
$package = Get-ISPackage -path "C:\Program Files\Microsoft SQL Server\100\DTS\Packages\sqlpsx1.dtsx"
$package.VersionBuild

这篇关于如何使用 PowerShell 从 SSIS 包文件中提取值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆