Setting Extended Properties with PowerShell
We’ve been looking at working with extended file properties with PowerShell using the Shell.Application COM object.
$shellApp = New-Object -ComObject 'Shell.Application'
$path = 'C:\work'
$shellFolder = $shellApp.NameSpace($Path)
$file = $shellFolder.Items() | where { $_.name -eq 'PHI_4928.jpg' }
Once you know the attributes you want, you can create custom output.
[PSCustomObject]@{
Name = $shellFolder.GetDetailsOf($file, 0)
Size = $shellFolder.GetDetailsOf($file, 1)
Dimensions =$shellFolder.GetDetailsOf($file, 31)
BitDepth = $shellFolder.GetDetailsOf($file, 174)
Camera = $shellFolder.GetDetailsOf($file, 30)
}
Want to read the full issue?