本帖最后由 idwma 于 2022-3-13 20:23 编辑
回复 11# 5i365 - function md4xml(){
- $args[0].ChildNodes|%{
- if($_.title -eq $null){
- $p+='\'+$_.text
- if(!(test-path ".$pp$p")){
- $a=dir -rec -inc $p.Split('\')[-1] ".$pp"
- if($a.count -gt 1){
- $a|%{"{0} {1}" -f $j++,$_.fullname}
- "-> .$pp$p"
- [int]$i=read-host
- if($i -match '\d'){move $a[$i].fullname ".$pp$p\.."; ac log.txt $("{0} -> {1}" -f $a[$i].fullname,".$pp$p")}
- rv i,j
- }elseif($a -ne $null){move $a.fullname ".$pp$p\.."; ac log.txt $("{0} -> {1}" -f $a.fullname,".$pp$p")}else{mkdir ".$pp$p"}
- }
- md4xml $_
- rv p
- }else{
- $pp='\'+$_.title
- if(!(test-path ".$pp")){mkdir ".$pp"}
- }
- }
- }
- md4xml $xmldata.ChildNodes.Item(1)
复制代码
|