I am trying to create a powershell script that will give me a list of every file in our cluster that is greater than 4GB.
The script must include file path information and output to a .txt file.
So far, I only have the bones of a script and I've been testing it on my work PC.
The final version will likely have to be run on the domain controller, but I am not sure how to build the script from the context of the DC.
$path = "C:\Users\LJONAH"
$sizeThreshold = 10
$outputPath = "C:\temp\OIS_large_files.txt"
Get-ChildItem -Path $path -Recurse -File -ErrorAction SilentlyContinue |
Where-Object {$_.Length / 1MB -gt $sizeThreshold}| Select-Object FullName, @{Name="Size GB";Expression={ "{0:N0}" -f ($_.Length / 1GB) }} | Out-File -FilePath $outputPath