The script will show how to search for files in C drive with 1GB and over.
Search your drive or folder for 1GB size or greater files
Get-ChildItem -Path C:\NewFolder -File -Recurse -ErrorAction SilentlyContinue | Where-Object {$_.Length -gt 1GB} |
Sort-Object length -Descending | Select-Object Name,Directory,@{n='GB';e={"{0:N2}" -F ($_.length/ 1GB)}} | Format-List Name,Directory,GB
Search your drive or folder for 500MB size or greater files
Get-ChildItem -Path C:\NewFolder -File -Recurse -ErrorAction SilentlyContinue |
Where-Object {$_.Length -gt 500MB} | Sort-Object length -Descending |
Select-Object Name,Directory,@{n='MB';e={"{0:N2}" -F ($_.length/ 1MB)}} | Format-List Name,Directory,MB
Get-ChildItem -Path C:\Windows\*.log
Search for 5 character word with extension log
Get-ChildItem -Path C:\Windows\?????.log
Search for files starting with ne
Get-ChildItem -Path C:\NewFolder\[ne]*
Search for files in drive and exclude win files
Get-ChildItem -Path C:\WINDOWS\System32\w*32*.dll -Exclude win*