{"id":30331894,"url":"https://github.com/jdhitsolutions/diskreportingtools","last_synced_at":"2025-08-28T09:07:34.009Z","repository":{"id":298525831,"uuid":"876936411","full_name":"jdhitsolutions/DiskReportingTools","owner":"jdhitsolutions","description":"A set of PowerShell tools for disk reporting and visualization. The tools rely on CIM cmdlets so this module requires a Windows platform. :floppy_disk: :page_with_curl:","archived":false,"fork":false,"pushed_at":"2025-06-24T12:38:53.000Z","size":1550,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-11T19:57:32.637Z","etag":null,"topics":["disk-usage","powershell","reporting"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdhitsolutions.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-22T19:56:02.000Z","updated_at":"2025-08-02T15:17:33.000Z","dependencies_parsed_at":"2025-06-11T16:20:06.273Z","dependency_job_id":null,"html_url":"https://github.com/jdhitsolutions/DiskReportingTools","commit_stats":null,"previous_names":["jdhitsolutions/diskreportingtools"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jdhitsolutions/DiskReportingTools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdhitsolutions%2FDiskReportingTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdhitsolutions%2FDiskReportingTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdhitsolutions%2FDiskReportingTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdhitsolutions%2FDiskReportingTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdhitsolutions","download_url":"https://codeload.github.com/jdhitsolutions/DiskReportingTools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdhitsolutions%2FDiskReportingTools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270940608,"owners_count":24671678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["disk-usage","powershell","reporting"],"created_at":"2025-08-18T03:39:56.848Z","updated_at":"2025-08-18T03:39:57.313Z","avatar_url":"https://github.com/jdhitsolutions.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DiskReportingTools\n\n[![PSGallery Version](https://img.shields.io/powershellgallery/v/DiskReportingTools.png?style=for-the-badge\u0026label=PowerShell%20Gallery)](https://www.powershellgallery.com/packages/DiskReportingTools/) [![PSGallery Downloads](https://img.shields.io/powershellgallery/dt/DiskReportingTools.png?style=for-the-badge\u0026label=Downloads)](https://www.powershellgallery.com/packages/DiskReportingTools/)\n\n![Volume](images/Volume01.png)\n\nThis PowerShell module contains functions to generate reports or gather information about storage devices. The module should work on Windows PowerShell 5.1 and PowerShell 7. Many of the commands rely on the CIM cmdlets and traditional PowerShell remoting. `Show-FolderUsage` and `Show-DriveUsage` should work on non-Windows platforms, although support and compatibility for MacOS has not been tested.\n\nInstall the module from the PowerShell Gallery.\n\n```powershell\nInstall-PSResource DiskReportingTools\n```\n\nWhile you can use the commands in production, they might be equally valuable as models for your own PowerShell scripting.\n\n## Commands\n\nThe module contains the following commands:\n\n| Name | Alias | Synopsis |\n|------|-------|----------|\n| [Get-DiskReportingTools](docs/Get-DiskReportingTools.md) |  | Get command details for DiskReportingTools |\n| [Get-RecycleBinSize](docs/Get-RecycleBinSize.md) | *rbsz* | Get recycle bin size |\n| [New-HtmlDriveReport](docs/New-HtmlDriveReport.md) |  | Create a drive HTML report |\n| [Show-DriveUsage](docs/Show-DriveUsage.md) | *sdu* | Display a colorized graph of disk usage |\n| [Show-DriveView](docs/Show-DriveView.md) | *sdv* | Display a summary view of all drives |\n| [Show-FolderUsage](docs/Show-FolderUsage.md) | *sfu* | Show folder usage by file extension |\n| [Show-FolderUsageAge](docs/Show-FolderUsageAge.md) | *sfa* | Show folder usage by file age |\n\n### [Get-RecycleBinSize](docs/Get-RecycleBinSize.md)\n\nThis Windows-only command will return the size of the recycle bin for each logical drive.\n\n```powershell\nPS C:\\\u003e Get-RecycleBinSize\n\n   Computername: PROSPERO\n\nDrive RecycleBinMB\n----- ------------\nC:    0.3\nD:    4.97\nG:    0\nH:    0\n```\n\nThe default is a formatted view with size formatted to megabytes. The \"raw\" value is in bytes.\n\n```powershell\nPS C:\\\u003e Get-RecycleBinSize | Where Drive -EQ 'c:' | Select *\n\nComputerName Drive RecycleBinSize\n------------ ----- --------------\nPROSPERO     C:         310112.00\n```\n\nYou can also query a remote computer.\n\n```powershell\nPS C:\\\u003e Get-RecycleBinSize -ComputerName cadenza\n\n   Computername: CADENZA\n\nDrive RecycleBinMB\n----- ------------\nC:    1286.6\nG:    0.21\n```\n\nOr multiple remote computers.\n\n```powershell\nPS C:\\\u003e rbsz \"Win10\",\"win11\",\"srv1\" -Credential $artd\n\n   Computername: WIN10\n\nDrive RecycleBinMB\n----- ------------\nC:    39.24\n\n   Computername: WIN11\n\nDrive RecycleBinMB\n----- ------------\nC:    301.09\n\n   Computername: SRV1\n\nDrive RecycleBinMB\n----- ------------\nC:    0\n```\n\nThis example is using the `rbsz` alias for `Get-RecycleBinSize`.\n\n### [New-HtmlDriveReport](docs/New-HtmlDriveReport.md)\n\nThis Windows-only command will create an HTML report of disk usage for one or more computers. Drive usage will be represented as a bar graph. You can customize the report title and heading.\n\n```powershell\nNew-HtmlDriveReport -ComputerName DOM1,DOM2,SRV1,SRV2,WIN10,WIN11 -ReportTitle \"Company Disk Report\" -HeadingTitle \"June 2024 Company Server Disk Report\" -Path c:\\temp\\company-disk.html\n```\n\n![Company Disk Usage Report](images/html-disk-report.png)\n\n### [Show-DriveUsage](docs/Show-DriveUsage.md)\n\nThis command uses the PowerShell console to display a colorized graph of disk usage.\nThe graph will be color coded depending on the amount of free disk space.\n\n![Show-DriveUsage](images/show-driveusage.png)\n\nThe default behavior is to display the graph for all local, fixed drives. You can specify a single drive or multiple drives.\n\n![Show-DriveUsage Single Drive](images/show-driveusage-company.png)\n\nThe drive usage thresholds are hard-coded into the command. They could be surfaced as parameters.\n\nThis command should work Linux systems. Support for MacOS has not been implemented or tested. Pull requests are welcome.\n\n![Show-DriveUsage Linux](images/show-driveusage-linux.png)\n\nOn non-Windows systems, the only supported parameter is `-Raw`.\n\n```powershell\nPS /home/jeff\u003e $r = Show-DriveUsage -Raw\nPS /home/jeff\u003e $r\n\nComputerName Drives\n------------ ------\nWILMA        {@{Path=/dev/sda2; TotalSize=25108740; Used=14340724; Free=9467232; UsedPercent=61;...\n\nPS /home/jeff\u003e $r.drives\n\nPath        : /dev/sda2\nTotalSize   : 25108740\nUsed        : 14340724\nFree        : 9467232\nUsedPercent : 61\nMount       : /\n\nPath        : /dev/sda1\nTotalSize   : 523248\nUsed        : 6288\nFree        : 516960\nUsedPercent : 2\nMount       : /boot/efi\n```\n\n### [Show-DriveView](docs/Show-DriveView.md)\n\nA related command in `Show-DriveView`. This command will display a summary view of all local, fixed drives. The default behavior is to send the output to `Out-GridView`.\n\n```powershell\nShow-DriveView -computername $computers\n```\n\n![Show-DriveView](images/show-drivereport.png)\n\nBut if you are running PowerShell 7 and have the `Microsoft.PowerShell.ConsoleGuiTools` module installed, you can use the dynamic `ConsoleGridView` parameter.\n\n```powershell\nShow-DriveView -Title \"Company Drive View\" -ComputerName SRV1,SRV2,Dom1,Dom2 -ConsoleGridView\n```\n\n![Show-DriveView ConsoleGridView](images/console-driveview.png)\n\n### [Show-FolderUsage](docs/Show-FolderUsage.md)\n\nThis command will display folder usage by file extension. The default output is a color formatted display of extensions showing a percentage of the total folder size. The output is limited to files that meet a minimum threshold percentage of the total folder size. The default threshold is 5%. You can change this value with the `-Threshold` parameter.\n\n![Show-FolderUsage](images/show-folderusage.png)\n\nThe graphical output shows the count for each file extension.\n\nThis command is also supported on non-Windows platforms, although it can only query the local computer.\n\n![Show-FolderUsage Linux](images/show-folderusage-linux.png)\n\n```powershell\nPS /home/jeff\u003e Show-FolderUsage . -Raw | Where-Object Pct -gt 1 |\nSort-Object Size -Descending | Format-Table\n\nName  Count        Size Computername       Total   Pct Path\n----  -----        ---- ------------       -----   --- ----\n.mp3      8 30745335.00 BamBam       77257099.00 39.80 /Home/Jeff\n.zip      7 14932249.00 BamBam       77257099.00 19.33 /Home/Jeff\n.jpg     10 11614356.00 BamBam       77257099.00 15.03 /Home/Jeff\n.m4a      1  9436993.00 BamBam       77257099.00 12.22 /Home/Jeff\n.pdf      7  4533731.00 BamBam       77257099.00  5.87 /Home/Jeff\n.mscz     4  3169090.00 BamBam       77257099.00  4.10 /Home/Jeff\n.png     22  1289211.00 BamBam       77257099.00  1.67 /Home/Jeff\n```\n\n### [Show-FolderUsageAge](docs/Show-FolderUsageAge.md)\n\nA related command is `Show-FolderUsageAge`. This command will display folder usage by file age based on the `LastWriteTime` property, although you can specify `CreationTime` with the `Property` parameter.\n\n![Show-FolderUsageAge](images/show-folderusage-age.png)\n\n## Raw Data\n\nCommands that visualize or customize the output should also have a `-Raw` parameter that will return the raw data as a PowerShell object. This is useful if you want to use the data in a script to create your own visualizations or reports.\n\nFor example, you might want to use the charting features in the [pwshSpectreConsole](https://github.com/ShaunLawrie/PwshSpectreConsole) module to create a custom report.\n\n```powershell\nParam([string[]]$Computername = $env:COMPUTERNAME)\n\n$raw = Show-DriveUsage -ComputerName $Computername -Raw | Group-Object -Property ComputerName\n\n$panelTitle = \"[Gold1]Drive Usage Percentage[/]\"\n\n$out = @()\nforeach ($computer in $raw) {\n    $data = @()\n    foreach ($item in $computer.group.drives) {\n        [double]$pct =[math]::Round(100 - $item.PercentageFree,2)\n        if ($pct -ge 60) {\n            $color = 'LightGreen'\n        }\n        elseif ($pct -ge 40) {\n            $color = 'SandyBrown'\n        }\n        elseif ($pct -ge 20) {\n            $color = 'DarkOrange'\n        }\n        else {\n            $color = 'DarkMagenta'\n        }\n        $data += New-SpectreChartItem -Label $item.DeviceID -Value $pct -Color $color\n    }\n`\n$title = @\"\n\n[HotPink Italic]$($Computer.name)[/]\n\n\"@\n\n    $out+= Format-SpectreBarChart -Data $data -Label $title -width 75\n\n}\n\n#display as a panel\n$out | Format-SpectreColumns | Format-SpectrePanel -Title $panelTitle -Width 90 -Color Lime\n```\n\n![pwshSpectreConsole Report](images/spectreconsole-example.png)\n\n## Other Features\n\n### Get-DiskReportingTools\n\nUse `Get-DiskReportingTools` to get a list of commands in the module. The command will return a list of commands with their names, aliases, and a brief description.\n\n![Get-DiskReportingTools](images/get-diskreportingtools.png)\n\nThe command shows exported commands. If you are on a non-Windows platform, you will see a different set of commands.\n\n### Localization\n\nThis module uses localization for Verbose and other messages. The module also uses a private helper function to display verbose messages using ANSI formatting.\n\n![custom verbose message](images/custom-verbose.png)\n\n### Information Stream\n\nSome functions also support the information stream. You will need to use the `-InformationVariable` parameter to capture the information stream. The information stream is a collection of messages that can be used for logging or debugging.\n\n```powershell\nPS C:\\\u003e $r = Show-FolderUsage c:\\scripts -ComputerName win10 -raw -InformationVariable v\nPS C:\\\u003e $v\nSystem.Management.Automation.PSBoundParametersDictionary\nSystem.Collections.Hashtable\nTotal size: 127583 bytes\nSystem.Object[]\nPS C:\\\u003e $v[1].MessageData\n\nName                           Value\n----                           -----\nComputerName                   win10\nHideComputerName               True\nArgumentList                   c:\\scripts\nErrorAction                    Stop\nScriptBlock                    ...\nPS C:\\\u003e $v[-1].MessageData[0]\n\nName       : .gitignore\nCount      : 1\nSize       : 658\nRunspaceId : 7bfadb82-b177-4748-9232-c554590b17c2\nTotal      : 127583\nPct        : 0.515742692992013\n```\n\n## Feedback\n\nI am open to pull requests if you want to contribute to the module. If you find bugs or have suggestions, please open an issue on the [GitHub repository](https://github.com/jdhitsolutions/DiskReportingTools). I have also enabled [Discussions](https://github.com/jdhitsolutions/DiskReportingTools/discussions) for non-issue questions or comments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdhitsolutions%2Fdiskreportingtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdhitsolutions%2Fdiskreportingtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdhitsolutions%2Fdiskreportingtools/lists"}