trendsger.blogg.se

Using scan filter foldersizes
Using scan filter foldersizes













using scan filter foldersizes

$folderOutput.GetEnumerator() | sort-Object Name | format-table -autosize | out-file -width $outputWidth $findFilesFoldersOutput -append $folderOutput.Add("$targetDir", "$folderSizeComplete") $total = "" -f ($folderSize / 1MB) + "MB" $disk = Get-WmiObject Win32_LogicalDisk -Filter "DeviceID='$diskDrive'" | Select-Object Size,FreeSpace $Time = Get-Date -format "dd-MMM-yyyy-HH-mm" # Search for specific file extensions - Default *.* # Limit number of rows on output, top XX files $findFilesFoldersOutput = "C:\FindLargestFilesAndFolders.txt" # appended to the txt file generated during the initial scan. # the size of all sub folders within a particular folder, output will be

using scan filter foldersizes

At the end of the script is an option to scan and list # folders sizes of the c:\ drive (default). # This script will find the 10 (default) largest files and then list the

  • Change directory to where the script is and running it by typing.
  • Set your execution policy in PowerShell accordingly.
  • There are variables at the top of the script that can be edited to change various settings like the drive, extensions, file size, amount of files to list (ie top 25) and so on. Notes: As always with PowerShell, you will need to set the execution policy for your environment accordingly.
  • Interactive scan of specific sub folders.
  • List the size of all of the folders on the root dir.
  • Scan the drive for total space free and used.
  • It is also nice to be able to pull this off without installing any software. That is why I call this my “low disk space” script.

    using scan filter foldersizes

    I find this script particularly useful in situations where you have a lot of servers that are being monitored for disk space and you need to quickly and easily find the largest offenders but take all of that information and put it in a readable format. This is a super easy to use and flexible PowerShell script to find out what the largest files and folders are on a single drive. 2021/04/powershell-script-quickly-find-the-largest-files/ Update – – I have an updated version of this script that is a little more flexible and has better output, you can find the new script here:















    Using scan filter foldersizes