遍历文件夹及子文件夹_函数

$CurrentFolder = "E:\Temp\jj"


Function GetSubFolder ($CurrentFolder)
{
$items = Get-ChildItem -Path $CurrentFolder
Foreach ($item in $items)
{
If ($item.Mode -eq "d----")
{GetSubFolder $item.pspath}
Else {
$item.Name
$item.psparentpath
}
}

}

GetSubFolder $CurrentFolder

posted on 2013-11-24 11:18  momingliu11  阅读(311)  评论(0编辑  收藏  举报