码迷,mamicode.com
首页 > 系统相关 > 详细

Powershell文件管理

时间:2015-07-16 22:33:26      阅读:188      评论:0      收藏:0      [点我收藏+]

标签: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文件管理

标签:powershell

原文地址:http://suxin.blog.51cto.com/535505/1675368

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!