Skip to content

🪲[Bug]: LogGroup function source and variable scoping in LogGroups #90

@vercellone

Description

@vercellone

Describe the bug

I've forked your GitHub repo intending to contribute some Codespace and Secret functions and am having difficulty building it locally to test my new functions before pushing anywhere.

  1. Build-PSModule depends on LogGroup which is not defined in this repo nor the Utilities module. Set-GitHubLogGroup has a LogGroup alias, so I assume that is the intended function here.
    1. Perhaps you should have a default implementation of LogGroup inside Utilities.
    2. Or, alternatively, you could fully qualify LogGroup as GitHub\Set-GitHubLogGroup.
  2. Functions and variables defined inside of LogGroup scriptblocks go out of scope and are not defined unless I dot-source the LogGroup call itself.

Version information

Name                           Value
----                           -----
PSVersion                      7.4.6
PSEdition                      Core
GitCommitId                    7.4.6
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     0.2.2                 Utilities                           Core,Desk {ConvertFrom-Base64, ConvertFrom-Base64String, ConvertTo-Base64, ConvertTo-Base64String…}

And, latest main branches of Build-PSModule and GitHub.

To reproduce

Try to use Build-PSModule locally to build GitHub in a fresh environment.

Code snippet

Build-PSModule -modulename GitHub -Modulesourcefolderpath 'D:\src\github\GitHub\src' -ModulesOutputFolderPath 'D:\src\github\GitHub\out' -DocsOutputFolderPath 'D:\src\github\GitHub\outdocs'

Relevant output

::group::Building module [GitHub]
Source path:          [D:\src\github\GitHub\src]
Module source folder: [D:\src\github\GitHub\src]
Module output folder: [D:\src\github\GitHub\out\GitHub]
Docs output folder:   [D:\src\github\GitHub\outdocs]
::endgroup::
Build-PSModule [main ≡ +0 ~2 -0 !]                                                                                                                                                    0d 0:00:00.0652 08:05:49 PM
0012
Build-PSModuleBase: D:\src\github\Build-PSModule\scripts\helpers\Build-PSModule.ps1:50:68
Line |
  50 |  … oduleName $ModuleName -ModuleSourceFolder $moduleSourceFolder -Module …
     |                                              ~~~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'ModuleSourceFolder' because it is null.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions