Hello Powershell v.2

Text version to get the items [Lnr's, Items, Times, Audio Formats] or other items.

You need the "text editeur" for Powershell to run this scripte. Ex. from Download the Powergui her!

cls

# path
$Xpath = "C:\.... Your FolderName go's her.....\JukeBox.xml"

# Open the XML file
$XJukeBox = New-Object System.XML.XMLDocument 
[xml]$XJukeBox = Get-Content $Xpath

# Header
$Xheader = "   <tr><td>Lnr</td><th>Item's</th><th>Times</th><th>Formats</th></tr>"

$XtableHead = " <table>"

$XtableFoot = " </table>"

# Read the XML file				
$Xarray = @($XJukeBox.selectNodes("/Audio/File/track[@type=""General""]") | Where-Object { $_.CompleteName } | Sort-Object -Property 'CompleteName' -Unique )  

# Start process

# Add header
""
$XtableHead

        for ($Xi = 0; $Xi -lt $Xarray.Count; $Xi++) 
            {     
                # LignCounter (Lnr) = ItemCounter  
                if ($Xi % 10 -eq 0)     
                    {         
                        ""
                        $Xheader     
                    }      
                $Xuser = $Xarray[$Xi]      
                
                $Xname = (get-culture).TextInfo.ToTitleCase($Xuser.CompleteName)      
                "       <tr><th><strong>{0:###}.</strong><th>" -f ($Xi + 1)     
                "           <td><strong>$($Xuser.CompleteName)</strong></td>"
                            # Adapte the TimesStamp     
                "           <td>"+(new-timespan -start "00:00:00" -end $Xuser.Duration_String)+"</td>"     
                "           <td>$($Xuser.Format)</td>"
                "       </tr>"
                ""
            }  
	# Add Footer
	$XtableFoot
	
	clear-variable X* -scope global -F
	
	# End scripte
	# Thats all Folk.

You get:

 <table>

<tr><td>Lnr</td><th>Item's</th><th>Times</th><th>Formats</th></tr>
    <tr><th><strong>1.</strong></th>
        <td><strong>1.Symph-Beethoven.mp3</strong></td>
        <td>00:05:08</td>
        <td>MPEG Audio</td>
    </tr>

    <tr><th><strong>2.</strong></th>
        <td><strong>1Chicago1969.mp3</strong></td>
        <td>00:12:31</td>
        <td>MPEG Audio</td>
    </tr>  

. . / . . .
 
 </table>

You can see the stuff at: The JukeBox-Table

png new.gif
© Arenas Mars. 2015