PowerShell / PowerShellEditorServices

A common platform for PowerShell development support in any editor or application!
MIT License
616 stars 209 forks source link

Fix repeated failure to load DSC module #2020

Closed andyleejordan closed 1 year ago

andyleejordan commented 1 year ago

While debugging the Write-Output bug (hence the branch name) I came across another bug where the server was attempting to load the DSC module repeatedly. The SetLineBreakpoint logic queries for DSC breakpoint capability, which was importing the module, catching the failure to import as an error, and then trying again every single time. Instead we should import (or fail to import) only the first time we try. Also, we don't need to transform the BreakpointDetails list into an array and back, just leave it as IEnumerable.