首页 > 系统服务 > 详细

Powershell文件管理

时间:2015-07-16 22:32:39      阅读:301      评论:0      收藏:0      [点我收藏+]

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!