Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Extract and transfrom metadata of all image files in a folder#powershell
Function Get-FileMetaData {
Param([string[]]$folder)
foreach($sFolder in $folder)
{
$a = 0
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.namespace($sFolder)
foreach ($File in $objFolder.items())
{
$FileMetaData = New-Object PSOBJECT
for ($a ; $a -le 266; $a++)
{
if($objFolder.getDetailsOf($File, $a))
{
$hash += @{$($objFolder.getDetailsOf($objFolder.items, $a)) =
$($objFolder.getDetailsOf($File, $a)) }
$FileMetaData | Add-Member $hash
$hash.clear()
} #end if
} #end for
$a=0
$FileMetaData
} #end foreach $file
} #end foreach $sfolder
} #end Get-FileMetaData
$metadata = Get-FileMetaData 'C:\Users\janik\LocalDrive\GitHub\janikvonrotz.ch\static\images\Bicycle Tour Amrum'
$metadata | ForEach-Object {
"{{< figure src=`"/images/Bicycle Tour Amrum/$($_.Filename)`" title=`"$($_.Title)`" >}}`n"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.