Directory Tree Structure script

%3CLINGO-SUB%20id%3D%22lingo-sub-2299374%22%20slang%3D%22en-US%22%3EDirectory%20Tree%20Structure%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2299374%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%2C%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EI%20am%20trying%20to%20create%20a%20Script%20were%20it%20would%20list%20the%20directory%20path%20in%20tree%20format.%20Basically%20lets%20say%20c%3A%5Cprogram%20files%5Ccommon%20files%5Cmicrosoft%20is%20the%20given%20path.%20i%20need%20a%20output%20like%26nbsp%3B%3CBR%20%2F%3Ec%3A%5C%3CBR%20%2F%3Ec%3A%5Cprogram%20files%5C%3CBR%20%2F%3Ec%3A%5Cprogram%20files%5Ccommon%20files%5C%3CBR%20%2F%3Ec%3A%5Cprogram%20files%5Ccommon%20files%5Cmicrosoft%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewith%20get-child%20item%20i%20can%20create%20a%20folder%20structure%20in%20tree%20format%20but%20not%20the%20other%20of%20given%20path.%3CBR%20%2F%3E%3CBR%20%2F%3Eplease%20share%20if%20you%20script%20or%20possible%20logic%20to%20achieve%20this%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2299374%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

Hi , 

I am trying to create a Script were it would list the directory path in tree format. Basically lets say c:\program files\common files\microsoft is the given path. i need a output like 
c:\
c:\program files\
c:\program files\common files\
c:\program files\common files\microsoft

 

with get-child item i can create a folder structure in tree format but not the other of given path.

please share if you script or possible logic to achieve this

0 Replies