手机
当前位置:查字典教程网 >脚本专栏 >PowerShell >Powershell小技巧之找出最大最小值
Powershell小技巧之找出最大最小值
摘要:要找出对象的最大最小值,请使用Measure-Object:$list=1,4,3,1,3,12,990$result=$list|Meas...

要找出对象的最大最小值,请使用Measure-Object:

$list = 1,4,3,1,3,12,990 $result = $list | Measure-Object -Minimum -Maximum $result.Minimum $result.Maximum

它支持多个数据并且还支持不通的数据类型,这里将它小小的修改就能返回WINDOWS目录下最近新创的文件:

$list = Get-ChildItem -Path C:windows $result = $list | Measure-Object -Property LastWriteTime -Minimum -Maximum $result.Minimum $result.Maximum

只需要设置对象其中的一个属性就能够查看你想要的信息。

支持所有PS版本

【Powershell小技巧之找出最大最小值】相关文章:

Powershell小技巧之使用-F方法带入数据

Powershell小技巧之系统运行时间

Powershell小技巧之播放WAV声音

Powershell小技巧之使用WMI测试服务响应

Powershell小技巧之通过EventLog查看近期电脑开机和关机时间

PowerShell脚本性能优化技巧总结

PowerShell是什么?

PowerShell小技巧之同时使用可选强制参数

Powershell小技巧之复合筛选

PowerShell设置文件只读、隐藏属性的方法

精品推荐
分类导航