Skip to main content

Get-FileMetaData

SYNOPSIS​

This function gets file metadata and returns it as a custom PS Object.

SYNTAX​

Get-FileMetaData [[-Path] <String[]>] [<CommonParameters>]

DESCRIPTION​

This function gets file metadata using the Shell.Application object and returns a custom PSObject object that can be sorted, filtered or otherwise manipulated.

EXAMPLES​

EXAMPLE 1​

Get-FileMetaData -Path "e:\music"
Gets file metadata for all files in the e:\music directory

EXAMPLE 2​

Get-FileMetaData -Path (gci e:\music -Recurse -Directory).FullName
This example uses the Get-ChildItem cmdlet to do a recursive lookup of all directories in the e:\music folder and then it goes through and gets all of the file metada for all the files in the directories and in the subdirectories.

EXAMPLE 3​

Get-FileMetaData -Path "c:\fso","E:\music\Big Boi"
Gets file metadata from files in both the c:\fso directory and the e:\music\big boi directory.

EXAMPLE 4​

$meta = Get-FileMetaData -Path "E:\music"
This example gets file metadata from all files in the root of the e:\music directory and stores the returned custom objects in a $meta variable for later processing and manipulation.

PARAMETERS​

-Path​

The path that is parsed for files

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters​

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS​

OUTPUTS​

System.Object​

NOTES​

ALIASES​

None.

PLATFORM APPLICABILITY​

Windows only. The platform-aware loader does not export this command on Linux or macOS.

POWERSHELL COMPATIBILITY​

See PowerShell compatibility for the supported runtime policy. PowerShell 7.6 LTS is preferred.

https://docs.keldor.dev/powershell/keldor/Get-FileMetaData