Skip to content

Commit afdf982

Browse files
feat: Simplifying OpenGraph module scaffolding ( Fixes #14 )
1 parent 957fcc7 commit afdf982

3 files changed

Lines changed: 6 additions & 64 deletions

File tree

.github/workflows/OpenGraph-Build.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
Install-Module -Name Pester -Repository PSGallery -Force -Scope CurrentUser -MaximumVersion $PesterMaxVersion -SkipPublisherCheck -AllowClobber
3636
Import-Module Pester -Force -PassThru -MaximumVersion $PesterMaxVersion} @Parameters
3737
- name: Check out repository
38-
uses: actions/checkout@v4
38+
uses: actions/checkout@v2
3939
- name: RunPester
4040
id: RunPester
4141
shell: pwsh
@@ -92,6 +92,9 @@ jobs:
9292
$result =
9393
Invoke-Pester -PassThru -Verbose -OutputFile ".\$moduleName.TestResults.xml" -OutputFormat NUnitXml @codeCoverageParameters
9494
95+
"::set-output name=TotalCount::$($result.TotalCount)",
96+
"::set-output name=PassedCount::$($result.PassedCount)",
97+
"::set-output name=FailedCount::$($result.FailedCount)" | Out-Host
9598
if ($result.FailedCount -gt 0) {
9699
"::debug:: $($result.FailedCount) tests failed"
97100
foreach ($r in $result.TestResult) {
@@ -490,21 +493,7 @@ jobs:
490493
if: ${{ success() }}
491494
steps:
492495
- name: Check out repository
493-
uses: actions/checkout@v2
494-
- name: GitLogger
495-
uses: GitLogging/GitLoggerAction@main
496-
id: GitLogger
497-
- name: Use PSSVG Action
498-
uses: StartAutomating/PSSVG@main
499-
id: PSSVG
500-
- name: Use PipeScript Action
501-
uses: StartAutomating/PipeScript@main
502-
id: PipeScript
496+
uses: actions/checkout@main
503497
- name: UseEZOut
504498
uses: StartAutomating/EZOut@master
505-
- name: UseHelpOut
506-
uses: StartAutomating/HelpOut@master
507-
- name: Use PSJekyll Action
508-
uses: PowerShellWeb/PSJekyll@main
509-
id: PSJekyll
510499

OpenGraph.ps.psm1

Lines changed: 0 additions & 26 deletions
This file was deleted.

OpenGraph.psm1

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,6 @@ $commandsPath = Join-Path $PSScriptRoot Commands
1010
. $file.FullName
1111
}
1212

13-
$myModule = $MyInvocation.MyCommand.ScriptBlock.Module
14-
$ExecutionContext.SessionState.PSVariable.Set($myModule.Name, $myModule)
15-
$myModule.pstypenames.insert(0, $myModule.Name)
16-
17-
New-PSDrive -Name $MyModule.Name -PSProvider FileSystem -Scope Global -Root $PSScriptRoot -ErrorAction Ignore
18-
19-
if ($home) {
20-
$MyModuleProfileDirectory = Join-Path ([Environment]::GetFolderPath("LocalApplicationData")) $MyModule.Name
21-
if (-not (Test-Path $MyModuleProfileDirectory)) {
22-
$null = New-Item -ItemType Directory -Path $MyModuleProfileDirectory -Force
23-
}
24-
New-PSDrive -Name "My$($MyModule.Name)" -PSProvider FileSystem -Scope Global -Root $MyModuleProfileDirectory -ErrorAction Ignore
25-
}
26-
27-
# Set a script variable of this, set to the module
28-
# (so all scripts in this scope default to the correct `$this`)
29-
$script:this = $myModule
30-
31-
#region Custom
32-
#endregion Custom
33-
34-
Export-ModuleMember -Alias * -Function * -Variable $myModule.Name
13+
Export-ModuleMember -Alias * -Function *
3514

3615

0 commit comments

Comments
 (0)