I’m trying to export the filename and the Title property from some mp4 files to a csv file.
Using Get-ChildItem and Get-ItemProperty show limited info; none of these dig deep into the properties (metadata) that I’m looking to extract.
Both of the following produce the same results:
Get-ChildItem -Path "D:\Movies\Casper's First Christmas (1979).mp4"
Get-ItemProperty "D:\Movies\Casper's First Christmas (1979).mp4"
Although I can get the information I need using what appears to be an outdated module (Get-FileMetaData), it runs extremely slow. It takes 3.75 seconds per file from a local drive (NVMe) and 14 seconds per file from my NAS. I’m hoping to find an alternate solution if one exists with greater performance.
That’s a kind of feature by design. Access to network ressources is always slower than local access. So it might be faster to transfer the desired files to a local drive, process them there and transfer them back.
To be sure you may measure where exactly the bottle neck is with Measure-Command. If it’s really the old module and you’re not able to improve it yourself you’re pretty much out of luck I think. How often do you need to run this task?
Edit:
I just took a look to the function Get-FileMetaData and I guess you’re using it wrong. While it works with the pipeline it might be much faster if you provide a folder path to the function and use its output later on to process it outside the function.
I sort of took a hiatus on this endeavor. I let my original code run to completion (25 hours) and decided to work with that output considering it gave me what I was looking for.
However, my efforts with trying to line up the filles with the correct ‘Title’, I discovered that was far too complex and decided to restore my Snapshot (NAS) on that media folder. From there, I just had to use “Restore previous versions” to restore a handful of files that weren’t in the Snapshot.
I recall trying your suggestion, but unfortunately it produced no information. The variable came up empty.
I don’t think I’ll use that module and will likely need to look at other tools that are commonly used to manage and manipulate media files and their respective metadata.