:
dir $dirName | select -first ((dir $dirName).Length -1) | del
, .
: , dir:
$include=$False; dir $dirNam | where {$include; $include=$True;} | del
, , , . , , :
$include=$False; dir $dirNam | where {$include -and $_.GetType() -ne [System.IO.DirectoryInfo]; $include=$True;} | del
2 Mode. , , ( , ). :
$_.Mode -notmatch "^d.{4}"
, - :
function isNotDir($file) { return $file.GetType() -ne [System.IO.DirectoryInfo];}
dir $dirName | where {isNotDir($_)}