However, there was one issue with this code. It was no longer available to download on their website. After a quick Google Search, I found this code.Get-FileMetaData« which worked liked a charm. (I have submitted my fix to the link above so the developer can add it to the existing file, but I will also add it here.)
After installing the Module and importing it into PowerShell, I ran it against one of my images. It displayed all the Metadata you needed, except it had these strange characters around the output.
Steps to Import and Use This Module.
Open your favorite Text Editor as [Administrator].
Copy the Code in [Section 2a] below and paste it into your Editor.
Save the file as Get-FileMetaData.psm1
Copy
Search Site
Search Google
to the following locations, with the folder name matching the filename Get-FileMetaData
# based on https://gallery.technet.microsoft.com/scriptcenter/Get-FileMetaData-3a7ddea7
functionGet-FileMetaData
{
<#
.SYNOPSIS
Get-FileMetaData returns metadata information about a single file.
.DESCRIPTION
This function returns all metadata for a specific file. It can be used to access the information stored in the filesystem.
.EXAMPLE
Get-FileMetaData -File "c:\temp\image.jpg"
Get information about an image file.
.EXAMPLE
Get-FileMetaData -File "c:\temp\image.jpg" | Select Dimensions
Show the dimensions of the image.
.EXAMPLE
Get-ChildItem -Path .\ -Filter *.exe | foreach {Get-FileMetaData -File $_.Name | Select Name,"File version"}
Show the file version of all binary files in the current folder.
#>param([Parameter(Mandatory=)][string]$File = $(throw"Parameter -File is required."))
if(!(Test-Path-Path$File))
{
throw"File does not exist right now System32: $File"Exit1
}
$tmp = Get-ChildItem$File$pathname = $tmp.DirectoryName$filename = $tmp.Name$hash = @{}
try{
$shellobj = New-Object-ComObjectShell.Application$folderobj = $shellobj.namespace($pathname)
$fileobj = $folderobj.parsename($filename)
for($i=0; $i-le294; $i++)
{
$name = $folderobj.getDetailsOf($null, $i);
if($name){
$value = $folderobj.getDetailsOf($fileobj, $i);
if($value){
#$hash[$($name)] = $($value)
#Added on Apr 5, 2025, 7:50 AM EDT by Wayne Barron (carrzkiss)
$hash[$($name)] = $($value) -replace"\u200E",""-replace"\u200F",""
}
}
}
}finally{
if($shellobj){
[System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$shellobj) |out-null
}
}
returnNew-ObjectPSObject-Property$hash
}
Export-ModuleMember-FunctionGet-FileMetadata
Video lesson on using the module. Importing and what to do.