locked
Export-CSV to Multiple folders RRS feed

  • Question

  • I need to create a script to export the results of

    Get-Childitem -Path "RootFolder" -Include "Terms" -Recurse -ErrorAction SilentlyContinue | Select-Object Directory, Name, LastWriteTime, LastAccessTime | Export-Csv -Path Report.csv -Append -NoTypeInformation

    And I want to create a new CSV or a worksheet for 2 layers deep sub folders

    Such as

    create a CSV for /Root/RSUB/RSUBSUB1\

    create a CSV for /Root/RSUB/RSUBSUB2\

    without having to run it 100 times for each sub folder manually

    • Moved by Bill_Stewart Tuesday, December 31, 2013 11:22 PM Abandoned thread
    Monday, October 28, 2013 6:57 PM

Answers

  • Layer one:

    dir \scripts\* -Directory

    Layer two:
    dir \scripts\*\* -Directory

    You can pipe them to get a complete list.


    ¯\_(ツ)_/¯

    Monday, October 28, 2013 7:36 PM