I am trying to write a tag system in Powershell. I would like to be able to set the 'tag' of my choice in the file, for example, using the 'title' field, since I do not use it. The files I would like to mention are a mixture of photos / videos and text.
It was easy for me to read / get extended file attributes, as there are several examples available on the network, but it is very difficult for me to find examples of changing or writing extended file properties; especially in Powershell.
I managed to write 'titles' to files using taglib-sharp, but it seems to have problems with various photos, and there is little information to troubleshoot. Plus this applies only to audio / video / photo files.
This is the code I should read in the title (in the test photo):
$path = 'C:\temp\photo.jpg' $shell = New-Object -COMObject Shell.Application $folder = Split-Path $path $file = Split-Path $path -Leaf $shellfolder = $shell.Namespace($folder) $shellfile = $shellfolder.ParseName($file) $shellfolder.GetDetailsOf($shellfile, 21)
Can someone tell me how can I update this attribute and then write / save it to a file?
source share