I am trying to search in specific path for folder and subfolder that less than the size that the user enterd but i do not get any result (in MB)

by Oct 30, 2019

[int]$x = read-host Enter the size in MB
$size = ($x * 1024144)

$files= Get-ChildItem C:Users -Recurse | Select-Object Name, Length

if ($files.Length -gt $size){
Get-ChildItem C:Users -Recurse | Where-Object{$_.Length -gt $grootte} | Sort-Object -Property @{Expression = "Length"; Descending=$true} |Select-Object -First 10 | Format-Table Name, Length