We have a requirement to pull out the version information for all of our packages per project and cross reference that with the version information in SSISDB. I figured i would extract the .dtproj xml info I need into a table and then do a compare.
As a novice Powershell developer this is as far as I have got. It gives me the exact info I need but the data is per row as it appears in the xml file. I would like the data in a table format as follows
| Name | versionMajor | VersionMinor | VersionBuild |
|---|---|---|---|
| PackageName1 | 1 | 0 | 5 |
| PackageName2 | 1 | 0 | 21 |
here is the xml snippet
<SSIS:PackageMetaData SSIS:Name="SomePackage.dtsx">
<SSIS:Properties>
<SSIS:Property SSIS:Name="ID">{C55A0E46-B4E5-4CE5-8387-277E0472906F}</SSIS:Property>
<SSIS:Property SSIS:Name="Name">SomePackage</SSIS:Property>
<SSIS:Property SSIS:Name="VersionMajor">1</SSIS:Property>
<SSIS:Property SSIS:Name="VersionMinor">0</SSIS:Property>
<SSIS:Property SSIS:Name="VersionBuild">5</SSIS:Property>
<SSIS:Property SSIS:Name="VersionComments">
</SSIS:Property>
<SSIS:Property SSIS:Name="VersionGUID">{9A60744B-6F04-41BF-9F0C-A820BBD3FDCA}</SSIS:Property>
<SSIS:Property SSIS:Name="PackageFormatVersion">6</SSIS:Property>
<SSIS:Property SSIS:Name="Description">
</SSIS:Property>
<SSIS:Property SSIS:Name="ProtectionLevel">0</SSIS:Property>
</SSIS:Properties>
this is my code
$namespace = @{SSIS = "www.microsoft.com/SqlServer/SSIS"}
$packageXpath = "//SSIS:PackageMetaData//SSIS:Property"
$packageNodes = Select-Xml -Path $path -XPath $packageXpath -Namespace $namespace | ForEach-Object{$_.Node}
$packageNodes | Format-Table
Looking for the easiest way to do this. I have seen examples using regular expressions to transpose the data from a file and also examples where the element names (not the attributes) are the columns I need using @{Label}.
Thanks in advance.

