I am at the last stages with my pester tests, but am having issues with the variable scoping.
I have quite a few tests and would like use something like Global scoping in order to declare variables such as $ModuleName
, $ProjectRoot
, and other similar things that are needed in each test.
I have tried using New-Variable -Scope Global
and $Global:ModuleName
but these don't seem to be visible in the Pester Tests.
I am calling Invoke-Pester
from a build.ps1
file which has these declared.
Has anyone seen any good ways to use centrally defined variables, without using $env:
variables?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…