# Listing 1: FileInfo1.ps1 # Run the FileInfo.cmd file. # Send output down the pipeline. c:\scripts\fileinfo.cmd | # Filter out all files except the "current" files. where-object { $_ -like "*current*.txt" } | # Sort the collection in descending order by filename. sort-object { $_.substring(39) } -descending | # Retrieve the filename from each item in the collection. # Display the filename in uppercase letters. foreach-object { write-host $_.substring(39).toUpper() }