大佬们,请教个问题啊,关于windows powershell脚本的Get-ChildItem语句

原问题:大佬们,请教个问题啊,关于windows powershell脚本的Get-ChildItem语句
分类:编程开发 > 最后更新时间:【2017-07-26 14:14:45】
问题补充:

在windows powershell窗口中运行下面的语句,出现数字长量无效:1

Get-ChildItem -Path $env:ProgramFiles -Recurse -Include *.exe | Where-Object -FilterScript {($_.LastWriteTime -gt "2005-10-01") -and ($_.Length -ge 1m) -and ($_.Length -le 10m)}

要怎么解决的啊

最佳答案

正确的写法是

Get-ChildItem -Path $env:ProgramFiles -Recurse -Include *.exe | Where-Object -FilterScript {($_.LastWriteTime -gt "2005-10-01") -and ($_.Length -ge 10240) -and ($_.Length -le 102400)}

网上直接抄的一般都是有错的

  • 追答:
    数值可以你调整 ,我的是10K(10240)~100K(102400)的
    最佳答案由网友  whoami1978  提供
  • 公告: 为响应国家净网行动,部分内容已经删除,感谢网友理解。
    6

    分享到:

    其他回答

    暂无其它回答!

      推荐