Skip to content

Commit cdd62f2

Browse files
StartAutomatingStartAutomating
StartAutomating
authored and
StartAutomating
committed
feat: PSJekyll.HelpOut ( Fixes #18 )
Refreshing docs, removing MAML
1 parent 64617e3 commit cdd62f2

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

PSJekyll.psm1

+10-20
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
1-
$myGitDirectory = Join-Path $PSScriptRoot .git
2-
if (Test-Path $myGitDirectory) {
3-
$commandsPath = Join-Path $PSScriptRoot Commands
4-
Write-Verbose "Git directory found, loading commands from $commandsPath"
5-
:ToIncludeFiles foreach ($file in (Get-ChildItem -Path "$commandsPath" -Filter "*-*" -Recurse)) {
6-
if ($file.Extension -ne '.ps1') { continue } # Skip if the extension is not .ps1
7-
foreach ($exclusion in '\.[^\.]+\.ps1$') {
8-
if (-not $exclusion) { continue }
9-
if ($file.Name -match $exclusion) {
10-
continue ToIncludeFiles # Skip excluded files
11-
}
12-
}
13-
. $file.FullName
14-
}
15-
} else {
16-
Write-Verbose "Git directory not found, loading allcommands.ps1"
17-
. (Join-Path $PSScriptRoot "allcommands.ps1")
1+
$commandsPath = Join-Path $PSScriptRoot Commands
2+
:ToIncludeFiles foreach ($file in (Get-ChildItem -Path "$commandsPath" -Filter "*-*" -Recurse)) {
3+
if ($file.Extension -ne '.ps1') { continue } # Skip if the extension is not .ps1
4+
foreach ($exclusion in '\.[^\.]+\.ps1$') {
5+
if (-not $exclusion) { continue }
6+
if ($file.Name -match $exclusion) {
7+
continue ToIncludeFiles # Skip excluded files
8+
}
9+
}
10+
. $file.FullName
1811
}
1912

20-
2113
$myModule = $MyInvocation.MyCommand.ScriptBlock.Module
2214
$ExecutionContext.SessionState.PSVariable.Set($myModule.Name, $myModule)
2315
$myModule.pstypenames.insert(0, $myModule.Name)
@@ -32,8 +24,6 @@ if ($home) {
3224
New-PSDrive -Name "My$($MyModule.Name)" -PSProvider FileSystem -Scope Global -Root $MyModuleProfileDirectory -ErrorAction Ignore
3325
}
3426

35-
$KnownVerbs = Get-Verb | Select-Object -ExpandProperty Verb
36-
3727
# Set a script variable of this, set to the module
3828
# (so all scripts in this scope default to the correct `$this`)
3929
$script:this = $myModule

0 commit comments

Comments
 (0)