1
0
mirror of https://github.com/jaapbrasser/SharedScripts.git synced 2025-12-24 21:51:38 +02:00

Added psiscontainer clause

This commit is contained in:
Jaap Brasser
2019-10-04 14:07:20 -06:00
parent 0ff324bb56
commit 85f77419cd

View File

@@ -23,10 +23,12 @@ function New-GitHubMarkdownIndex {
Get-ChildItem -LiteralPath $Path | ForEach-Object {
$GHPath = $_.FullName -replace [regex]::Escape($Path) -replace '\\','/' -replace '\s','%20'
"* [$(Split-Path $_ -Leaf)]($GitHubUri$GHPath)"
$_ | Get-ChildItem -Recurse | ? {$_.PSIsContainer -or $_.Extension -in $IncludeExtensions} | ForEach-Object {
$Count = ($_.FullName -split '\\').Count-($Path.Split('\').Count+1)
$GHPath = $_.FullName -replace [regex]::Escape($Path) -replace '\\','/' -replace '\s','%20'
"$(" "*$Count*2)* [$(Split-Path $_ -Leaf)]($GitHubUri$GHPath)"
if ($_.PSIsContainer) {
$_ | Get-ChildItem -Recurse | ? {$_.PSIsContainer -or $_.Extension -in $IncludeExtensions} | ForEach-Object {
$Count = ($_.FullName -split '\\').Count-($Path.Split('\').Count+1)
$GHPath = $_.FullName -replace [regex]::Escape($Path) -replace '\\','/' -replace '\s','%20'
"$(" "*$Count*2)* [$(Split-Path $_ -Leaf)]($GitHubUri$GHPath)"
}
}
}
}