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

$CurrentFolder = "E:Tempjj"


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

原文地址:https://www.cnblogs.com/dreamer-fish/p/3439832.html