Skip to content

Instantly share code, notes, and snippets.

Last active July 20, 2020 18:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Extract and transfrom metadata of all image files in a folder#powershell
Function Get-FileMetaData {
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
} #end if
} #end for
} #end foreach $file
} #end foreach $sfolder
} #end Get-FileMetaData
$currentFolder = Get-Location
$metadata = Get-FileMetaData $currentFolder
$metadata | ForEach-Object {
"{{< figure src=`"/images/$(Split-Path $currentFolder -Leaf)/$($_.Filename)`" title=`"$($_.Title)`" >}}`n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment