Requirements icon indicating copy to clipboard operation
Requirements copied to clipboard

Improve documentation around Parameter values not accessible in Test and Set

Open cdhunt opened this issue 5 years ago • 0 comments

Sample code: https://gist.github.com/cdhunt/80984dea7c6e45f42badf6c7f7f7bd8f

I've tried .GetNewClosure() on the Test and Set block as described in the Readme and $Name is always $null.

However, adding .GetNewClosure() on the New-RequirementGroup scriptblock did create a correctly scoped closure.

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Linux 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

cdhunt avatar Sep 28 '20 18:09 cdhunt