-
Notifications
You must be signed in to change notification settings - Fork 8.3k
pwsh 7.0.0-rc.1 - Scoping in ForEach method change ? #11522
Copy link
Copy link
Closed
Labels
Breaking-Changebreaking change that may affect usersbreaking change that may affect usersIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Metadata
Metadata
Assignees
Labels
Breaking-Changebreaking change that may affect usersbreaking change that may affect usersIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
So I have an odd issue and @IISResetMe said to file a bug report so I have. This came about because I changed my VS Code to use pwsh 7 as default, which is a good thing but lead to this issue.
I was running Pester checks against the dbachecks module as I do frequently. The code that is failing was written 2/3 years ago (by someone else!) and hasn't been touched since. Certainly, if I was re-writing it, there are better ways to do it, but it shows what we think is a change in scope in the ForEach method between preview-2 (where Mathias could not reproduce the issue) and rc1 where I can
Steps to reproduce
In Windows PowerShell
In PowerShell Core 6.2.3
Actual behavior in PowerShell 7.0.0-rc.1
There is no output
but this works as expected
Environment data