| external help file | PowerTree-help.xml |
|---|---|
| Module Name | powertree |
| online version | https://github.com/spaansba/PowerTree |
| schema | 2.0.0 |
A modern replacement for the tree command with advanced filtering, sorting, and display options.
Show-PowerTree [[-LiteralPath] <String>] [-Depth <Int32>] [-Examples] [-PruneEmptyFolders] [-DisplayAll]
[-DisplayMode] [-DisplaySize] [-DisplayModificationDate] [-DisplayCreationDate] [-DisplayLastAccessDate]
[-DirectoryOnly] [-ExcludeDirectories <String[]>] [-Sort <String>] [-SortByModificationDate]
[-SortByCreationDate] [-SortByLastAccessDate] [-SortBySize] [-SortByName] [-Descending]
[-FileSizeMinimum <String>] [-FileSizeMaximum <String>] [-FileSizeFilter <String>]
[-ExcludeExtensions <String[]>] [-IncludeExtensions <String[]>] [-ShowHiddenFiles] [-OutFile <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
PowerTree is an advanced alternative to the traditional tree command available in Windows and Unix systems. It provides visualization of directory structures with advanced filtering, sorting, and display options that make exploring and documenting file systems more efficient.
Unlike the standard tree command, PowerTree offers:
- Detailed file information (size, dates, attributes)
- Multiple sorting options (by name, size, date etc.)
- Filtering capabilities (by extension, size, directory)
- Customizable configuration via JSON
- Export functionality to save output to files
PS C:\> Show-PowerTree
# Shorthand
PS C:\> ptreeShows the basic tree structure of the current directory. This is your starting point for exploring any directory structure.
PS C:\> Show-PowerTree -DisplaySize -SortBySize -Descending -FileSizeMinimum 10MB
# Shorthand
PS C:\> ptree -s -ss -desc -fsmi 10MBDisplays only files larger than 10MB and sorts them from largest to smallest. This creates a "disk usage audit" view of your directory. File sizes are displayed in human-readable format (KB, MB, GB) by default. To show exact byte counts instead, use Edit-PowerTreeConfig and set HumanReadableSizes to false.
PS C:\> Show-PowerTree -DisplayAll -ExcludeDirectories bin,obj,node_modules
# Shorthand
ps C:\> ptree -da -e bin,obj,node_modulesShows complete file information (size, dates, mode) while excluding common build/dependency directories.
PS C:\> Show-PowerTree -DisplaySize -OutFile "powertree.txt"
# Shorthand
ps C:\> ptree -s -o "powertree"Generates a tree view with file sizes and saves the complete output to a text file instead of displaying it in the console. This is faster than console output as it doesn't have to write to the host.
Controls how many levels deep PowerTree will traverse into subdirectories.
Type: Int32
Parameter Sets: (All)
Aliases: l, level
Required: False
Position: Named
Default value: -1 (unlimited)
Accept pipeline input: False
Accept wildcard characters: FalseReverses the sort order for any active sorting method, showing results from largest to smallest or Z to A.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: des, desc
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseShows only folder structure without individual files in the output.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: d, dir
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseEnables all display options simultaneously including size, creation date, modification date, last accessed date and mode.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: da
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseDisplays when each file or folder was originally created.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: dcd
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseDisplays when files were last opened or accessed.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: dla
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseDisplays file system attributes using codes: directory (d), archive (a), readonly (r), hidden (h), system (s), and symbolic link (l).
Type: SwitchParameter
Parameter Sets: (All)
Aliases: dm, m
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseDisplays when files were last modified.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: dmd
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseDisplays file and folder sizes in readable units (KB, MB, GB) instead of raw byte counts. To show exact byte counts instead, use Edit-PowerTreeConfig and set HumanReadableSizes to false.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: s, size
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False{{ Fill Examples Description }}
Type: SwitchParameter
Parameter Sets: (All)
Aliases: ex, example
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseHides the specified folder names from the tree display. Accepts multiple directory names separated by commas.
Type: String[]
Parameter Sets: (All)
Aliases: e, exclude
Required: False
Position: Named
Default value: @()
Accept pipeline input: False
Accept wildcard characters: FalseHides files with the specified file extensions from the output. Accepts multiple extensions separated by commas.
Type: String[]
Parameter Sets: (All)
Aliases: ef
Required: False
Position: Named
Default value: @()
Accept pipeline input: False
Accept wildcard characters: FalseApplies advanced file size filtering using complex criteria in a single parameter.
Type: String
Parameter Sets: (All)
Aliases: fs, filesize
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseHides files that exceed the specified size limit. Supports size units like KB, MB, GB. (e.g 10kb)
Type: String
Parameter Sets: (All)
Aliases: fsma
Required: False
Position: Named
Default value: -1kb
Accept pipeline input: False
Accept wildcard characters: FalseShows only files larger than the specified threshold. Supports size units like KB, MB, GB. (e.g 10kb)
Type: String
Parameter Sets: (All)
Aliases: fsmi
Required: False
Position: Named
Default value: -1kb
Accept pipeline input: False
Accept wildcard characters: FalseShows only files with the specified file extensions, hiding all other file types. Accepts multiple extensions separated by commas.
Type: String[]
Parameter Sets: (All)
Aliases: if
Required: False
Position: Named
Default value: @()
Accept pipeline input: False
Accept wildcard characters: False{{ Fill LiteralPath Description }}
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseWrites the tree output to a text file instead of displaying it in the console. Faster than regular since we dont have to write to the host. Accepts both a name or a full path
Type: String
Parameter Sets: (All)
Aliases: o, of
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseExcludes empty folders from the output.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: prune, p
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False-ShowHiddenFiles
Shows hidden files and directories. (e.g. .git)
Type: SwitchParameter
Parameter Sets: (All)
Aliases: force
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSets the sorting criteria using predefined values: size, name, md (modified date), cd (creation date), or la (last access).
Type: String
Parameter Sets: (All)
Aliases:
Accepted values: size, name, md, cd, la
Required: False
Position: Named
Default value: name
Accept pipeline input: False
Accept wildcard characters: FalseSorts by creation date.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: scd
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSorts by last access date.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: sla, sld
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSorts by last modified date.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: smd
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSorts alphabetically by name (default).
Type: SwitchParameter
Parameter Sets: (All)
Aliases: sn
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseOrders files and folders by their size, from smallest to largest unless combined with -Descending.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: ss
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
You cannot pipe objects to Show-PowerTree.
Show-PowerTree outputs tree structure as text to the console and optionally to a file.
PowerTree provides extensive customization through a JSON configuration file. Use Edit-PowerTreeConfig to modify default settings.
File size filters support units: b, kb, mb, gb, tb.