Comments (5)

  1. frankys says:

    Just what i was looking for, thanks.

  2. Frodo says:

    Prefect! Thank you.

  3. DavidM says:

    Interesting, but it does not work on my PC. Windows 7 Home Premium, Powershell 2.0, gets this error when I try Get-FileMetaData -folder "e:Music":

    Add-Member : Cannot bind parameter ‘MemberType’. Cannot convert the "System.Collections.Hashtable" value of type "System.Collections.Hashtable" to type "System.Management.Automation.PSMemberTypes".
    At C:UsersDavidDesktopGet-FileMetaDataReturnObject.ps1:72 char:39
    + $FileMetaData | Add-Member <<<< $hash
    + CategoryInfo : InvalidArgument: (:) [Add-Member], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.AddMemberCommand

    This appears in red a number of times. I must be leaving something out, but I am not certain what (I am using the downloaded version of the script).

    Also, none of the other examples work on my PC:
    Get-FileMetaData -folder (gci e:music -Recurse -Directory).FullName
    indicates that that the gci option -Directory is not valid.

    This is the version of PowerShell:
    PS C:Windowssystem32> $PSVersionTable

    Name Value
    —- —–
    CLRVersion 2.0.50727.5485
    BuildVersion 6.1.7601.17514
    PSVersion 2.0
    WSManStackVersion 2.0
    PSCompatibleVersions {1.0, 2.0}
    SerializationVersion 1.1.0.1
    PSRemotingProtocolVersion 2.1

    Any ideas?

  4. GoVer says:

    [tag:requires] -version 3.0

  5. John says:

    The script works very good, thanks for sharing!
    But if you have a listing like this:
    C:SharesLab
    C:SharesScripts
    C:SharesLabdemo1
    C:SharesLabdemo2
    C:SharesLabdemo3
    C:SharesLabdemo4
    C:SharesLabdemo1start
    C:SharesLabdemo2advanced
    C:SharesScriptsTestScripts

    if you run this command:
    Get-FileMetaData (Get-childItem C:Shares -Recurse -Directory).FullName | Export-Csv C:SharesLabmeta.csv

    it lists almost everything, except:
    C:SharesLab
    C:SharesScripts

    So I think that the script skips the folders in the current directory and dives directly into the subfolders. Can you help me out to list the missing folders too?

Skip to main content