Home > Enteo, PowerShell Scripting > Cataloging Exported packages from Frontrange Enteo / DSM 7 with Powershell.

Cataloging Exported packages from Frontrange Enteo / DSM 7 with Powershell.

This is just a quick powershell script I threw together to catalog exported packages.

By default when you export packages from Frontrange DSM (formerly Enteo) you end up with a large list of unique id’s with no real idea which package is which.

The below quick and dirty Powershell function will enumerate the xml file in each package folder and create a catalog which you can then export to csv if you wish.

To retrieve the list of packages and names, use the following command:

(where c:\export is the location of your export)

get-DSMpackages -DirectoryPath "C:\Export"

This will present itself as below:

To export the file to csv, try the following:

(where c:\export is the location of your export, and you wish to save the csv file to c:\export\contents.csv)

get-DSMpackages -DirectoryPath "C:\Export" | Export-Csv C:\Export\contents.csv -notypeinformation

This should create the csv file and look as follows:

Below is the function:

function get-DSMpackages{
    param(
        [Parameter(Mandatory = $true)]
        [string]$DirectoryPath)

    $result=@()

    foreach ($folder in Get-ChildItem $directorypath | where {$_.psiscontainer -eq $true}){

        [xml]$XMLBlock = get-content "$($folder.fullname)\_ExpInfo.xml"
        $name=$xmlblock.dsmexport.ArrayOfMdsObject.MdsObject.Name
        if ($name -eq $null){
            [xml]$XMLBlock = get-content "$($folder.fullname)\_ExpInfo.xml"
            $name=$xmlblock.dsmexport.ArrayOfMdsObject.mdsobject[0].name
        }
        $entry = New-Object PSObject -Property @{
            Name=$Name
            GUID=$folder.name}
        $result+=$entry
    }#end for
    return ($result | sort name)
}#end function
  1. February 25, 2013 at 10:41 pm

    Excellent script, I will link back to this from my blog @ deployIT.org : The DSM blog.
    Thanks for sharing your script.

    Best greetings

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: