查询
Get-ChildItem -Path D:\logstash-1.4.2\bin\*.mdmp -Recurse -ErrorAction:SilentlyContinue | `
Where-Object -FilterScript {(((get-date) - ($_.CreationTime)).days -gt 20 `-and $_.PsISContainer -ne $True)} | Select-Object FullName
删除
Get-ChildItem -Path D:\logstash-1.4.2\bin\*.mdmp -Recurse -ErrorAction:SilentlyContinue | `
Where-Object -FilterScript {(((get-date) - ($_.CreationTime)).days -gt 20 `-and $_.PsISContainer -ne $True)} | Remove-Item -Force
参考了http://oicu.cc.blog.163.com/blog/static/1230394712011013101555201/,这个文章较为详细的介绍了,但其没有告诉你怎么匹配