Skip to content

PowerShell script allowing you to generate disk usage statistics.

License

Notifications You must be signed in to change notification settings

Kinsiinoo/PoshDirSize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

31a5ec6 Β· Mar 13, 2022

History

49 Commits
Apr 12, 2021
Feb 25, 2022
Feb 25, 2022
Mar 13, 2022
Mar 11, 2022

Repository files navigation

PoshDirSize (PowerShell Directory Size) - 0.1.2WIP

This PowerShell module allow you to generate disk usage statistics. The result will appear in the console and also in the OUTPATH folder as a PoshDirSize_{yyyy-MM-dd-HH-mm-ss}.log file.

Screenshots

WIP

Syntax

Get-PoshDirSize [-PoshDSPath] <string> [-PoshDSOutPath] <string> [-PoshDSMode {Fast | Slow}] [-PoshDSFileInc <string[]>] [-PoshDSFileExc <string[]>] [-PoshDSDirInc <string[]>] [-PoshDSDirExc <string[]>]  [<CommonParameters>]
Get-PoshDirSize [-PoshDSPath] <string> [-PoshDSOutPath] <string> [-PoshDSMode {Fast | Slow}] [-LongPath]  [<CommonParameters>]

Basic usage

Get-PoshDirSize PATH OUTPATH

Configuration

  • PoshDSMode = Default value is always Fast.
    • Fast: Faster, but more resource intensive. (foreach)
    • Slow: Slower, but more resource efficient. (ForEach-Object)
  • PoshDSFileInc = Include files based on name and file format.
    • Example: *.log, *.txt or DailyReport*.csv
  • PoshDSFileExc = Exclude files based on name and file format.
  • PoshDSDirInc = Include dirs based on name.
    • Example: System32, Users or 2022*Pics
  • PoshDSDirExc = Exclude dirs based on name.
  • LongPath = Include and correctly parse long paths.

Advanced

  • $PoshDSRunTime = You can configure the date format modifying the yyyy-MM-dd-HH-mm-ss section inside the module code.

Todo

Module

  • Generate some kind of chart πŸ’ΉπŸ“Š
  • Faster file writer (.NET StreamWriter)
  • Log: Extend the summary with data from new variables
  • Param: Switch for console output (enable/disable)
  • Param: OutPath
  • Param: OutFile, multiple naming format
  • Search: Handle long paths
  • Search: Handle long paths (UNC)
  • Search: Logic if directory / directories are excluded #2
  • Search: Switch between Path and LiteralPath #3
  • Search: Minimum and maximum file size
  • Search: Include/exclude files based on name and file format
  • Search: Include/exclude dirs based on name
  • Search: Depth
  • Search: Switch between fast/resource saving mode (partly done) ⚑/🌳
  • Refactor code into a nice PS module πŸ‘€

Repo

  • GitHub Actions
    • Version
    • Build
    • Test
    • Publish

Changelog

v0.1.2 (WIP)

  • Set WindowsTitle at start
  • Param: OutPath
  • Search: Include/exclude files based on name and file format
  • Search: Include/exclude dirs based on name
  • Wrong variable type for include / exclude variables #1
  • Search: Handle long paths
  • Log: Extend the summary with data from new variables
  • Search: Switch between Path and LiteralPath #3

v0.1.1

  • Refactored into a PS module
  • Added Fast/Slow mode (partly done)
  • Added some verbose logging
  • Escape special chars in path strings
  • Added output mode to console and .log file

Initial commit

  • Basic functionality

License

PoshDirSize is licensed under the MIT License.