- $c=@{1='│ ';2='├── ';3='└── '}
- function z($d,$e){
- $f=$c[2]
- $d=dir $d
- $d|%{
- if(++$i -eq $d.count){$f=$c[3]}
- if($_.PSIsContainer){
- '[{0,11}]{1}{2} {3}' -f 0, $e, $f, $_.name
- z -d $_.fullname -e ($c[1]+$e)
- }else{'[{0,11}]{1}{2} {3}' -f $_.length, $e, $f, $_.name}
- }
- }
- z
复制代码
|