Exhibit showing PowerShell closures misbehave with function name resolution.
PowerShell raises CommandNotFoundException
over a defined function called from a closure.
Raised and explained in pester/Pester#525.
Tested on Windows 10 with Pester.
The same issue is likely found in all PowerShell versions with the ScriptBlock
GetNewClosure
method.
Clone the repository and run Pester.
Set-Location
to the cloned repository.Invoke-Pester