Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Get-AvailableExtendedFilePropertyTable
- {
- <#
- Comment Based Help goes here ...
- #>
- [CmdletBinding()]
- Param
- (
- # add something to get only the matching names?
- )
- begin
- {
- $Path = 'C:\'
- $MetaDataLookup = [ordered]@{}
- $DefaultNameSpace = (New-Object -ComObject Shell.Application).NameSpace($Path)
- }
- process
- {
- # the 400 seems to be a magic number indicating the max possible items
- foreach ($Index in 1..400)
- {
- $DefaultNameSpace.GetDetailsOf($DefaultNameSpace, $Index) |
- Where-Object {-not [string]::IsNullOrEmpty($_)} |
- ForEach-Object {$MetaDataLookup.Add($_, $Index)}
- }
- }
- end
- {
- $MetaDataLookup
- }
- } # end >> function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement