How to find metadata is available from file-properties - PowerShell Help - PowerShell Forums

PHOTO EMBED

Sun Nov 17 2024 18:27:01 GMT+0000 (Coordinated Universal Time)

Saved by @baamn #metadata #powershell #comobject #shell.application

$MediaFiles = '*.mp3', '*.wav', '*.wma'
$Directory = 'D:\Users\Public\Public.Language\Pronounce it Perfectly in Spanish 2e\Pronounce it Perfectly in Spanish 2e.Down.Load'

$Shell = New-Object -ComObject Shell.Application

foreach($type in $MediaFiles){
    $sample = Get-ChildItem -Path $Directory -Recurse -Include $type | Select-Object -First 1
    
    if($sample){
        $sample | ForEach-Object {
            $Folder = $Shell.Namespace($_.DirectoryName)
            $File = $Folder.ParseName($_.Name)

            1..512 | ForEach-Object {
                $value = $Folder.GetDetailsOf($file, $_)
                
                if($value){
                    [PSCustomObject] @{
                        File     = $sample.FullName
                        Number   = $_
                        Property = $Folder.GetDetailsOf($null, $_)
                        Value    = $value
                    }
                }
            }
        }
    }
}

content_copyCOPY

You can also use this technique to extract all the available properties/values on a given file. This snippet will pull a sample wav, mp3, and wma file… assuming one exists somewhere within this directory.

https://forums.powershell.org/t/how-to-find-metadata-is-available-from-file-properties/23751