Skip to content

Commit 57113c8

Browse files
Aligning the pathing with the working manifest script
1 parent 62ec6b1 commit 57113c8

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

createpowershellmodule.ps1

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,20 @@ try
3030
$outputPath = "$($env:GITHUB_WORKSPACE)\$($Output)"
3131
}
3232

33-
$modulePath = "$($outputPath)\$($ModuleName).psm1"
33+
$Module = Get-ChildItem -Path $SourcePath -Filter "$($ModuleName).psd1" -Recurse
34+
$ModuleRoot = $Module.Directory.FullName
35+
$Destination = "$($outputPath)\$($ModuleName)"
36+
$modulePath = "$($Destination)\$($ModuleName).psm1"
3437

3538
if ($Debug)
3639
{
37-
Write-Host "::debug::ModuleName : $($ModuleName)"
38-
Write-Host "::debug::SourcePath : $($sourcePath)"
39-
Write-Host "::debug::OutputPath : $($outputPath)"
40-
Write-Host "::debug::ModulePath : $($modulePath)"
41-
Write-Host "::debug::Imports : $($imports)"
40+
Write-Host "ModuleName : $($ModuleName)"
41+
Write-Host "SourcePath : $($sourcePath)"
42+
Write-Host "OutputPath : $($outputPath)"
43+
Write-Host "Destination : $($Destination)"
44+
Write-Host "ManifestPath : $($ManifestPath)"
45+
Write-Host "ModuleRoot : $($ModuleRoot)"
46+
Write-Host "Imports : $($imports)"
4247
}
4348

4449
$stringbuilder = [System.Text.StringBuilder]::new()
@@ -50,7 +55,7 @@ try
5055

5156
if ($Debug)
5257
{
53-
Write-Host "::debug::Testing Output"
58+
Write-Host "Testing Output"
5459
}
5560

5661
if (-not (Test-Path -Path $outputPath)) {
@@ -60,28 +65,28 @@ try
6065
Write-Host "::group::Processing import folders..."
6166
foreach ($importFolder in $importFolders)
6267
{
63-
Write-Host "Importing from [$($sourcePath)\$($importFolder)]"
68+
Write-Host "Importing from [$($ModuleRoot)\$($importFolder)]"
6469
if ($Debug)
6570
{
66-
Write-Host "::debug::Testing ImportFolder"
71+
Write-Host "Testing ImportFolder"
6772
}
68-
if (Test-Path "$sourcePath\$importFolder")
73+
if (Test-Path "$ModuleRoot\$importFolder")
6974
{
70-
$fileList = Get-ChildItem "$($sourcePath)\$($importFolder)\*.ps1" -Exclude "*.Tests.ps1"
75+
$fileList = Get-ChildItem "$($ModuleRoot)\$($importFolder)\*.ps1" -Exclude "*.Tests.ps1"
7176
foreach ($file in $fileList)
7277
{
7378
Write-Host " Importing [.$($file.BaseName)]"
7479
if ($Debug)
7580
{
76-
Write-Host "::debug::Reading file: $file.FullName"
81+
Write-Host "Reading file: $file.FullName"
7782
}
7883
$stringbuilder.AppendLine("# .$($file.BaseName)") | Out-Null
7984
$stringbuilder.AppendLine([System.IO.File]::ReadAllText($file.FullName)) | Out-Null
8085
}
8186
}
8287
else
8388
{
84-
Write-Host "##[warning]Folder $importFolder not found at $sourcePath"
89+
Write-Host "##[warning]Folder $importFolder not found at $ModuleRoot"
8590
}
8691
}
8792
Write-Host "::endgroup::"

0 commit comments

Comments
 (0)