Skip to content

Latest commit

 

History

History
278 lines (230 loc) · 14.1 KB

CHANGELOG.md

File metadata and controls

278 lines (230 loc) · 14.1 KB

CHANGELOG

  • 09/12/2024

    • Added TreeStyle type and Get-PSTreeStyle cmdlet for rendering output.
    • Added Pester tests for TreeStyle.
    • Documented changes.
  • 09/03/2024

    • Makes Depth property public for PSTreeFileSystemInfo instances.

    • Makes GetParents() method private, absolutely no reason to have it public.

    • Added properties ItemCount and TotalItemCount to PSTreeDirectory instances, requested in Issue #34.

      PS ..\PSTree> pstree -Recurse -Force -Directory | Select-Object Hierarchy, Depth, ItemCount, TotalItemCount -First 15
      
      Hierarchy                  Depth ItemCount TotalItemCount
      ---------                  ----- --------- --------------
      PSTree                         0        15           1476
      ├── .git                       1        13           1078
      │   ├── hooks                  2        13             13
      │   ├── info                   2         1              1
      │   ├── logs                   2         2             24
      │   │   └── refs               3         2             22
      │   │       ├── heads          4         9              9
      │   │       └── remotes        4         1             11
      │   │           └── origin     5        10             10
      │   ├── objects                2       244            995
      │   │   ├── 00                 3         3              3
      │   │   ├── 01                 3         2              2
      │   │   ├── 02                 3         3              3
      │   │   ├── 03                 3         4              4
      │   │   ├── 04                 3         2              2
      
      PS ..\PSTree> (Get-ChildItem -Force).Count
      15
      PS ..\PSTree> (Get-ChildItem -Force -Recurse).Count
      1476
      PS ..\PSTree> (Get-ChildItem .git -Force).Count
      13
      PS ..\PSTree> (Get-ChildItem .git -Force -Recurse).Count
      1078
      PS ..\PSTree>
  • 08/29/2024

    • Added method .GetUnderlyingObject(). Outputs the underlying FileSystemInfo instance.
    • Fixes Issue #9: Sort by ascending values:
      • PSTree v2.1.16

        PS ..\PSTree> pstree -Directory -Depth 2
        
          Source: D:\...\PSTree
        
        Mode            Length Hierarchy
        ----            ------ ---------
        d----         25.27 KB PSTree
        d----          3.72 KB ├── tools
        d----         16.96 KB │   ├── ProjectBuilder
        d----          0.00  B │   └── Modules
        d----         13.66 KB ├── tests
        d----          0.00  B ├── src
        d----         13.26 KB │   └── PSTree
        d----        168.69 KB ├── output
        d----         92.50 KB │   ├── TestResults
        d----          0.00  B │   └── PSTree
        d----          6.26 KB ├── module
        d----          0.00  B ├── docs
        d----          7.37 KB │   └── en-US
        d----          4.11 KB ├── .vscode
        d----          0.00  B └── .github
        d----          4.10 KB     └── workflows
      • PSTree v2.1.17

        PS ..\PSTree> pstree -Directory -Depth 2
        
          Source: D:\Zen\Documents\Scripts\PSTree
        
        Mode            Length Hierarchy
        ----            ------ ---------
        d----         25.27 KB PSTree
        d----          0.00  B ├── .github
        d----          4.10 KB │   └── workflows
        d----          4.11 KB ├── .vscode
        d----          0.00  B ├── docs
        d----          7.37 KB │   └── en-US
        d----          6.26 KB ├── module
        d----        168.69 KB ├── output
        d----          0.00  B │   ├── PSTree
        d----         92.50 KB │   └── TestResults
        d----          0.00  B ├── src
        d----         13.26 KB │   └── PSTree
        d----         13.66 KB ├── tests
        d----          3.72 KB └── tools
        d----          0.00  B     ├── Modules
        d----         16.96 KB     └── ProjectBuilder
  • 02/26/2024

    • Added method .GetFormattedLength(). Outputs the friendly .Length representation of PSTreeFile and PSTreeDirectory instances.

      PS ..\PSTree> (Get-PSTree D:\ -RecursiveSize -Depth 0).GetFormattedLength()
      629.59 GB
  • 10/05/2023

    • Added Parameter -Include. Works very similar to -Exclude, the patterns are evaluated against the items .FullName property, however this parameter targets only files (FileInfo instances).
  • 09/11/2023

    • No changes to the cmdlet but a few improvements to the code base:
      • #16 PSTreeCache and PSTreeIndexer internal classes have been sealed following the recommendations from dotnet/runtime#49944.
      • #17 Indent extension method has been changed to use StringBuilder.
      • #19 Improved ConvertToTree method. Was too complicated and inefficient, there was also no need to use Regex.
      • #20 -Depth parameter type was changed from int to uint and the documentation was updated accordingly.
  • 07/28/2023

    • Added .ToString() method to PSTreeFileSystemInfo<T> instances, the method resolves to the instances .FullName property similar to FileSystemInfo.ToString Method. Now it should be possible to pipe Get-PSTree output to Get-Item and Get-ChildItem when needed:

      Get-PStree -Depth 0 | Get-Item
    • Added .Refresh() method to PSTreeFileSystemInfo<T>, functionality is the same as FileSystemInfo.Refresh Method.

    • Reorganizing source files and Pester tests.

    • Added more Pester tests.

    • Fixed a few documentation typos.

  • 07/03/2023

    • Added -Path parameter, now both -Path and -LiteralPath parameters take string[] as input and support pipeline input.

    • Added Pester tests, Code Coverage and coverage upload to codecov.io.

    • Removed .Size Property from PSTreeFile and PSTreeDirectory instances. The Size column has been renamed to Length and moved to the left-hand side of the Hierarchy column (I know it looks much better on the right-hand side 😑 but having it in the left allows for fixed width in the first 2 columns, which in turn brings less formatting issues 🤷‍♂️...).

      The default display for this column is available through [PSTree.Internal._Format]::GetFormattedLength(...), for example:

      Get-PSTree | Select-Object Hierarchy, @{ N='Size'; E={ [PSTree.Internal._Format]::GetFormattedLength($_.Length) }}
    • Added GroupBy tag to the default view, now trees are grouped by the source Path omg! Little example:

      PS ..\PSTree> Get-PSTree .\src\, .\module\ -Exclude *\obj,*\bin
      
        Source: C:\path\to\PSTree\src
      
      Mode            Length Hierarchy
      ----            ------ ---------
      d----          0.00  B src
      d----         10.30 KB └── PSTree
      -a---        931.00  B     ├── ExceptionHelpers.cs
      -a---        439.00  B     ├── PSTree.csproj
      -a---          1.06 KB     ├── PSTreeDirectory.cs
      -a---          4.01 KB     ├── PSTreeExtensions.cs
      -a---        517.00  B     ├── PSTreeFile.cs
      -a---        399.00  B     ├── PSTreeFileSystemInfo.cs
      -a---          1.51 KB     ├── PSTreeFileSystemInfo_T.cs
      -a---        897.00  B     ├── PSTreeHelper.cs
      -a---        619.00  B     ├── PSTreeIndexer.cs
      d----          1.13 KB     ├── Internal
      -a---          1.13 KB     │   └── _Format.cs
      d----          5.68 KB     └── Commands
      -a---          5.68 KB         └── GetPSTreeCommand.cs
      
        Source: C:\path\to\PSTree
      
      Mode            Length Hierarchy
      ----            ------ ---------
      d----          6.22 KB module
      -a---          1.54 KB ├── PSTree.Format.ps1xml
      -a---          4.67 KB └── PSTree.psd1
  • 03/22/2023

    • Get-PSTree is now a binary cmdlet. Functionality remains the same. Big thanks to SeeminglyScience and jborean93 for all their help!
    • Added -Exclude parameter to the cmdlet. The parameter accepts wildcards and patterns are matched with the object's .FullName property. For more details checkout cmdlet docs.
  • 02/25/2023

    • Fixed a bug that made Get-PSTree use -Recurse by default.
    • Added ETS properties to PSTreeDirectory and PSTreeFile instances that would make exporting the output easier.
  • 10/23/2022

    • PSTree Module is now published to the PowerShell Gallery!
    • Introducing -RecursiveSize switch parameter to Get-PSTree. By default, Get-PSTree only displays the size of folders based on the sum of the files length in each Directory. This parameter allows to calculate the recursive size of folders in the hierarchy, similar to how explorer does it. It's important to note that this is a more expensive operation, in order to calculate the recursive size, all folders in the hierarchy need to be traversed.
PS ..\PSTree> pstree -Directory -Depth 2

Mode  Hierarchy          Size
----  ---------          ----
d---- PSTree          9.51 Kb
d---- └── PSTree      4.83 Kb
d----     ├── public   4.8 Kb
d----     ├── private 0 Bytes
d----     └── Format  1.83 Kb

PS ..\PSTree> pstree -Directory -Depth 2 -RecursiveSize

Mode  Hierarchy            Size
----  ---------            ----
d---- PSTree          180.38 Kb
d---- └── PSTree       14.75 Kb
d----     ├── public     4.8 Kb
d----     ├── private   3.29 Kb
d----     └── Format    1.83 Kb
  • 06/19/2022
    • Added format view for the Module - PSTree.Format.ps1xml.
    • The module now uses EnumerateFileSystemInfos() instance method.
    • Improved error handling (a lot).
    • -Files parameter has been replaced with -Directory parameter, now the module displays files by default.
    • -Deep parameter has been replaced with -Recurse parameter, same functionality.
    • PSTreeDirectory and PSTreeFile instances now only include 2 visible properties, Hierarchy and Length, the rest is done with format view.
PS ..\PSTree> pstree -Recurse

Mode  Hierarchy                             Size
----  ---------                             ----
d---- PSTree                            10.21 Kb
-a--- ├── LICENSE                        1.07 Kb
-a--- ├── README.md                      9.15 Kb
d---- └── PSTree                         4.83 Kb
-a---     ├── PSTree.psd1                4.57 Kb
-a---     ├── PSTree.psm1              270 Bytes
d----     ├── public                      4.8 Kb
-a---     │   └── Get-PSTree.ps1          4.8 Kb
d----     ├── private                    0 Bytes
d----     │   └── classes                3.29 Kb
-a---     │       └── classes.ps1        3.29 Kb
d----     └── Format                     1.83 Kb
-a---         └── PSTree.Format.ps1xml   1.83 Kb