PowerShell sprawdź, czy ChildItem jest katalog

Get-ChildItem -Recurse -Path $pathSource | % {
    if ($_.PSIsContainer) {
        Write-Output "This is a directory, skip it"
    } else {
    	Write-Output "Do stuff"
    }
}
Michu44