项目作者: dark-coffee

项目描述 :
dir, but it actually shows folder size!
高级语言: PowerShell
项目地址: git://github.com/dark-coffee/GetDirectory.git
创建时间: 2020-02-05T21:31:35Z
项目社区:https://github.com/dark-coffee/GetDirectory

开源协议:MIT License

下载


Get-Directory

ModuleVersion

Compatible Versions

PowerShell
PowerShell
PowerShell

Operating Systems

Windows
MacOS

Installation

Install me from the PowerShell Gallery!

  1. Install-Module GetDirectory

Alternatively, use this hackier single-line command to get this module from Github!

  1. $PSModDir="$($env:PSModulePath|%{$_ -replace ";.*"})\GetDirectory\";if(!(Test-Path($PSModDir))){New-Item -Type Directory $PSModDir};Start-BitsTransfer 'https://raw.githubusercontent.com/dark-coffee/GetDirectory/master/GetDirectory.psm1' "$PSModDir\GetDirectory.psm1";Import-Module GetDirectory;

Screenshots

Screen1
Screen2

Module Notes

  • On MacOS, recursively polling all the directories (how I calculate size) will prompt for access to certain dirs (contacts, reminders, desktop etc.)
  • Dirs that are empty, or are symlinks will return a null or blank value for size.

Get-Help

  1. .SYNOPSIS
  2. Extends the Dir command to include folder sizes.
  3. .DESCRIPTION
  4. Extends the Dir command to include folder sizes.
  5. Will provide the standard Dir output, with a modified size column.
  6. .PARAMETER Path
  7. Specifies the path to run the command inside, else defaults to the current working directory.
  8. .PARAMETER SizeIn
  9. If specified (from KB,MB,GB) will display the folder size in that measurement.
  10. .INPUTS
  11. This module does not accept pipeline input.
  12. .OUTPUTS
  13. Standard output of Dir command, with a modified Size ([unit]) column.
  14. .EXAMPLE
  15. PS> Get-Directory
  16. Mode LastWriteTime Size (MB) Name
  17. ---- ------------- --------- ----
  18. d---- 04/06/2020 19:44:45 35.64 Applications
  19. d---- 14/10/2020 20:29:38 0 Desktop
  20. d---- 14/10/2020 20:22:06 5181.69 Documents
  21. d---- 14/10/2020 20:12:51 163949.76 Downloads
  22. .EXAMPLE
  23. PS> Get-Directory -SizeIn GB
  24. Mode LastWriteTime Size (GB) Name
  25. ---- ------------- --------- ----
  26. d---- 04/06/2020 19:44:45 0.03 Applications
  27. d---- 14/10/2020 20:29:38 0 Desktop
  28. d---- 14/10/2020 20:22:06 5.06 Documents
  29. d---- 14/10/2020 20:12:51 160.11 Downloads
  30. .EXAMPLE
  31. PS> Get-Directory -Path 'E:\Steam'
  32. Mode LastWriteTime Size (MB) Name
  33. ---- ------------- --------- ----
  34. d----- 08/06/2020 18:02:51 273572.47 steamapps
  35. -a---- 10/09/2020 08:05:38 0.41 steam.dll