PowerShell function explorer for Visual Studio Code.
Features
Displays a tree view of PowerShell functions found in workspace files with extensions .ps1, .psm1, and .psd1.
Functions and class definitions are grouped by workspace folder and directory structure.
Functions show a green icon, class definitions show an orange icon, and you can turn icons off with psfunc.showIcons.
Unused functions and classes (not referenced anywhere in the workspace) are shown with a gray icon by default.
Click a function or class node to open the file and jump directly to its definition.
Click a file node to open the file.
Refresh the function tree using the Refresh PowerShell Function Tree command.
Use psfunc.showAllFiles to show every workspace file in the tree, not just PowerShell files that contain functions or classes.
How it works
The extension scans workspace files matching **/*.{ps1,psm1,psd1}.
It parses each file for PowerShell function and class declarations.
It then scans all workspace file content to detect which functions and classes are referenced.
Functions and classes without any references are shown with an unused icon color.
Files without functions or classes are excluded from the tree view.
Function items include the function name, line location, and parameter summary when available.
Comments immediately above a function are used to extract a synopsis if present.
Commands
psfunc.refreshTree — Refresh the function explorer tree.
psfunc.openFunction — Open a file and navigate to the selected function.
psfunc.openFile — Open the selected PowerShell file.
Settings
Setting
Default
Description
psfunc.showAllFiles
false
Include every workspace file in the explorer tree, not only PowerShell files that contain functions or classes.
psfunc.showIcons
true
Show icons for function and class items in the tree view.
psfunc.functionColor
#068a1c
Color for PowerShell function icons.
psfunc.classColor
#d35400
Color for PowerShell class icons.
psfunc.unusedFunctionColor
#888888
Color for unused PowerShell function icons.
psfunc.unusedClassColor
#888888
Color for unused PowerShell class icons.
Notes
The explorer only includes workspace files that actually contain PowerShell functions or classes (unless psfunc.showAllFiles is enabled).
Folder structure in the tree reflects the workspace path hierarchy.
A function or class is considered "unused" when its name does not appear anywhere in the workspace beyond its own definition.
Release Notes
0.0.1
Initial release: PowerShell function tree explorer with file and function navigation.
0.0.2
Added icon for defining classes and function.
Added a setting to be able to add an icon or use the text [class] or [function] to append to the text
0.0.3
Added a button to refresh
Added a button to switch between showing all files or only files that have classes/functions
Changed the hover over the function to show the synopsis with better spacing for readability
0.0.4
Make available for Vscode 1.109
0.0.5
Added Lazy Loading
0.0.6
Make function icon green to differentiate between powershell files and functions
0.0.7
Fix sorting on folder and file level
0.0.8
Fix multiple issues
0.0.9
Add custom color setting for class and function icons; classColor and functionColor
Now correctly jumps to correct line if there is no synopsis defined for a function
0.0.10
Added tooltip for properties on classes
0.0.11
Added parameter to the top of the tooltip
Added markdown for readability
Added parameter type for functions
0.0.12
Added unusedFunctionColor and unusedClassColor settings for coloring unreferenced items
Functions and classes not referenced anywhere in the workspace are detected and displayed with a distinct icon color (gray by default)
Settings are live-reloaded on change without restart
0.0.13
Fixed bleed of parameters from the next function if the function had a different format. Instead of function { param( <parameters> ) <code> } if it was function ( <parameters>) { code } it would pick the parameter of the next function. Which makes it unreliable.
Also added tests for it
0.0.14
Added Pester test tree view support — Describe, Context, and It blocks are now shown in the tree hierarchy
Context items show a purple class-style icon
It items display with "It" prepended for readability
Fixed tree hierarchy bug where Context appeared at the same level as Describe
Fixed regex to handle test names containing the opposite quote type (e.g. "should return 'value'")
Fixed case-insensitive keyword matching for describe/context/it
Added comprehensive test suite for Pester parsing
0.0.15
Added describeColor and contextColor settings to customize Pester block icon colors
Fixed Pester hierarchy parsing to correctly nest Context and It blocks within their parent blocks
Refactored case-insensitive regex matching for Describe, Context, and It keywords (handles lowercase it)
Refactored additional tests for Pester parsing
0.0.16
Performance/Fix: Refactored Pester block parsing to use a single-pass stack algorithm, resolving hierarchy alignment issues in large files and mitigating high memory usage.