Patrick Meinecke

Results 430 comments of Patrick Meinecke

> with the general accepted approach, all the imported scripts share the the same (module) scope where actually only the function should be imported. There are a lot of other...

> > `Export-ModuleMember` > > This exactly an example that I would like to prevent (correct me if I am wrong, but I like to state): Don't even think about...

> I our organization, the "function scripts" are maintained by multiple developers. The issue is that I actually do _not_ want to `Invoke` (dot-source) the concerned "function scripts" but rather...

> As you point out yourself: "_Dot-sourcing has minor security risks_" where I think that the risks are actually slightly higher compared to using `Invoke-Expression` , as it is more...

Indeed, a `break` or `continue` statement outside of a loop is very bad, but that is also the case within a function.

> Agree, but note that `catch` and `finally` are formally listed as [reserved words](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_redirection), see also: [PowerShell/PSScriptAnalyzer#2099](https://github.com/PowerShell/PSScriptAnalyzer/issues/2099). Besides, the same (dubious) argument would apply for _someone that decides to define...

The Engine WG discussed this, we think this was by design and changing it now would be too large of a breaking change to consider. We would like to see...

I can't repro this in 7.4.6, can you try launching `pwsh` with `-NoProfile` to rule that out?

One extra tip, you don't actually have to spam them. Pressing enter at a blank prompt while debugging will repeat the previous command.

The Engine WG discussed this and agree