Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Show-Tree {
- param(
- [Parameter(Mandatory=$false)]
- [string]$Path = (Get-Location).Path,
- [string]$Indent = ""
- )
- # Add more as needed
- $excludeDirs = @('node_modules', '__pycache__', 'venv')
- $directories = Get-ChildItem -Path $Path -Directory | Where-Object { $excludeDirs -notcontains $_.Name }
- $files = Get-ChildItem -Path $Path -File
- foreach ($file in $files) {
- "$Indent$file"
- }
- foreach ($directory in $directories) {
- "$Indent$($directory.Name)/"
- Show-Tree -Path $directory.FullName -Indent "$Indent "
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement