Checklist
What is the issue?
With Pester.BeforeContianer.ps1 you get:
$pwd = Working dir when calling Invoke-Pester. Unstable 👎
$PSScriptRoot = Folder for Pester.BeforeContainer. Stable 👍
With Run.BeforeContainer you only get the unstable $pwd as there's no file path to calculate $PSScriptRoot from.
Expected Behavior
Provide a consistent path reference/anchor or recommendation
Steps To Reproduce
$c = New-PesterConfiguration
$c.Run.ScriptBlock = { Describe 'd' { It 'i' {} } }
$c.Run.BeforeContainer = { Write-Host "BeforeContainer script. PSScriptRoot: '$PSScriptRoot' . Pwd: '$pwd'" }
invoke-pester -Configuration $c
Describe your environment
No response
Possible Solution?
Maybe expose RepoRoot as a variable which would stable for all containers?
Checklist
What is the issue?
With
Pester.BeforeContianer.ps1you get:$pwd= Working dir when callingInvoke-Pester. Unstable 👎$PSScriptRoot= Folder for Pester.BeforeContainer. Stable 👍With
Run.BeforeContaineryou only get the unstable$pwdas there's no file path to calculate$PSScriptRootfrom.Expected Behavior
Provide a consistent path reference/anchor or recommendation
Steps To Reproduce
Describe your environment
No response
Possible Solution?
Maybe expose RepoRoot as a variable which would stable for all containers?