Avatar of bbimis
bbimis asked on

tree to excel

I am trying to capture all the directories (NAMES ONLY, and subdirectories) on a given network share.  I know i can do powershell and Get-ChildItem | tree > c:\tree.txt    but can someone help me get it so i can import it into excel in a nice layout so we can use it as a checklist?
Thanks!
PowershellScripting LanguagesShell Scripting

Avatar of undefined
Last Comment
bbimis

8/22/2022 - Mon
Subash Sundharan

Check the csv report format from following question and see if it works for you..
https://www.experts-exchange.com/Programming/Languages/Scripting/Powershell/Q_28212659.html
ASKER
bbimis

that looks great. I have one question though and I have no problem opening a new question if need be.  Here is ultimately what I need to figure out.

lets say i have
f:\common
apples
oranges
grapes

and they have files inside of them I want for each directory a csv file of all its file permissions
I have a powershell script that will do the WHOLE thing but i want it to go to one directory say apples and make a csv file called apples.csv  then when it finishes move on an make a csv file called oranges and so on.  Is this possible and if so can someone help me with the code.  this is what i have so far.

$path = 'F:\common’

$outFilename = Join-Path $path "Dir-$(Get-Date -Format 'yyyyMMdd-HHmmss').csv"

dir $path -attr !D -r | select Name, Extension, DirectoryName, Length, CreationTime, LastAccessTime, LastWriteTime | export-csv $outFilename -NoTypeInformation

Open in new window

ASKER CERTIFIED SOLUTION
Subash Sundharan

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
bbimis

I've requested that this question be closed as follows:

Accepted answer: 0 points for bbimis's comment #a39445574
Assisted answer: 500 points for Subsun's comment #a39445462

for the following reason:

thank you so much that is exactly what i needed!!!!
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER
bbimis

THANK YOU SO MUCH!!! This is what i needed!