@@ -69,6 +69,11 @@ BeforeDiscovery {
6969 If the BHBuildOutput environment variable exists, it is running in a psake build, so do not
7070 build the module. #>
7171 if ($null -eq $Env: BHBuildOutput ) {
72+ # Populate BuildHelpers env vars so build.psake.ps1's properties block has
73+ # the values it needs (BHPSModuleManifest, BHProjectName) — when running
74+ # via ./build.ps1 this happens before psake; running tests in isolation
75+ # bypasses that, so we do it here.
76+ Set-BuildEnvironment - Path (Split-Path - Parent $PSScriptRoot ) - Force
7277 $buildFilePath = Join-Path - Path $PSScriptRoot - ChildPath ' ..\build.psake.ps1'
7378 $invokePsakeParameters = @ {
7479 TaskList = ' Build'
@@ -122,6 +127,11 @@ BeforeAll {
122127 If the BHBuildOutput environment variable exists, it is running in a psake build, so do not
123128 build the module. #>
124129 if ($null -eq $Env: BHBuildOutput ) {
130+ # Populate BuildHelpers env vars so build.psake.ps1's properties block has
131+ # the values it needs (BHPSModuleManifest, BHProjectName) — when running
132+ # via ./build.ps1 this happens before psake; running tests in isolation
133+ # bypasses that, so we do it here.
134+ Set-BuildEnvironment - Path (Split-Path - Parent $PSScriptRoot ) - Force
125135 $buildFilePath = Join-Path - Path $PSScriptRoot - ChildPath ' ..\build.psake.ps1'
126136 $invokePsakeParameters = @ {
127137 TaskList = ' Build'
0 commit comments