标签:powershell
get-alias -definition get-childitem #dir的别名为get-childitem
#只列出目录
dir | where-object {$_ -is [System.IO.DirectoryInfo]}
dir | where-object {$_.PSIsContainer}
dir | where-object {$_.Mode.Substring(0,1) -eq "d"}
#只列出文件
dir | where-object {$_ -is [System.IO.FileInfo]}
dir | where-object {$_.PSIsContainer -eq $false}
dir | where-object {$_.Mode.Substring(0,1) -ne "d"}
本文出自 “百草素心” 博客,谢绝转载!
标签:powershell
原文地址:http://suxin.blog.51cto.com/535505/1675368