Patrick Meinecke
Patrick Meinecke
> Are there any breaking changes we need to discuss? Or can I just create the PR myself and get the glory like with `'1' | Test-Json`? Good question! I...
> Can someone please point me where are dynamic scope variables set? The global ones use `SessionStateInternal` but I can't find where dynamic ones are - `&{ $var = 1...
> @SeeminglyScience I don't get it, why is it generated code? Are PowerShell functions precompiled to .NET functions instead of interpreted on the fly? Does it mean that the fix...
So interpretation vs jitted isn't actually the difference here. The difference is whether the compiler is marked as "optimized". In unoptimized mode (dot sourced, debugging, a few other things) the...
> Proposed solution is to create a new `Set-StrictMode -Version 4.0` to avoid any breaking changes. I do also want to note that this isn't exactly the easy solution it...
> This clearly shows that optimized `+=` is the only case which skips getting the variable altogether, instead using `PSBinaryOperationBinder` and passing uninitialized (default initialized?) `local.Item009` to it. It does...
> @SeeminglyScience You're confusing this issue with #17911 . The problem this issue is trying to resolve is not the scope of the variable, but the fact that it is...
> not sure if the fact that a _custom class_ is used across thread boundaries is relevant. Yeah. It tries to marshal back to the original pipeline execution thread, but...
You can see it by doing this: ```powershell class Foo { static [object] Echo($val) { return [PSCustomObject]@{ ThreadId = [Threading.Thread]::CurrentThread.ManagedThreadId RunspaceId = [runspace]::DefaultRunspace.Id } } } $cls = [Foo] while...
That's a long winded way of saying it's basically a dupe of #4003. Though a significantly more likely to happen in the wild repro.