Summary
build.ps1 (repo root) fails to find Private/, Public/, and the .psd1 — it silently
builds a .psm1 with 0 private and 0 public functions and then errors copying the .psd1:
Building PureStorageFlashBladePowerShell...
Private functions: 0
Public functions: 0
Generated <repoParent>\build\PureStorageFlashBladePowerShell\PureStorageFlashBladePowerShell.psm1 (27 lines)
Copy-Item: build.ps1:106
Line |
106 | Copy-Item -Path $psd1Source -Destination $OutputPath
| Cannot find path '<repoParent>\PureStorageFlashBladePowerShell.psd1' because it does not exist.
Root cause
Introduced in fc6d8de1 (v2.0.4). The path-resolution comment/logic assumes the script now
lives in <repo>/scripts/build.ps1 and walks up one directory to find the repo root:
https://github.com/dmann000/fb-powershell/blob/main/build.ps1#L18-L22
# This script lives in <repo>/scripts/; the source files (Public/, Private/, .psd1,
# .psm1, LICENSE) live in <repo>/. Resolve repoRoot one level up.
$scriptDir = if ($PSScriptRoot) { $PSScriptRoot } else { Split-Path -Parent $MyInvocation.MyCommand.Path }
if (-not $scriptDir) { $scriptDir = (Get-Location).Path }
$repoRoot = Split-Path -Parent $scriptDir
But build.ps1 was never actually moved into a scripts/ folder — it's still at repo root
alongside Public/, Private/, and the .psd1. So $repoRoot resolves to the parent of the
repo, one directory too high.
Repro
from a clean checkout of main.
Suggested fix
Since the script is at repo root (not <repo>/scripts/), $repoRoot should just be
$scriptDir — see comment in the fix below.
Summary
build.ps1(repo root) fails to findPrivate/,Public/, and the.psd1— it silentlybuilds a
.psm1with 0 private and 0 public functions and then errors copying the.psd1:Root cause
Introduced in
fc6d8de1(v2.0.4). The path-resolution comment/logic assumes the script nowlives in
<repo>/scripts/build.ps1and walks up one directory to find the repo root:https://github.com/dmann000/fb-powershell/blob/main/build.ps1#L18-L22
But
build.ps1was never actually moved into ascripts/folder — it's still at repo rootalongside
Public/,Private/, and the.psd1. So$repoRootresolves to the parent of therepo, one directory too high.
Repro
./build.ps1from a clean checkout of
main.Suggested fix
Since the script is at repo root (not
<repo>/scripts/),$repoRootshould just be$scriptDir— see comment in the fix below.