AzureAD / MSAL.PS

MIT License
159 stars 29 forks source link

replace load of PS1 files in psd1 by a main psm1 loading the ps1 #59

Open MS-LUF opened 1 year ago

MS-LUF commented 1 year ago

Hello,

Not sure this title could be understand ^^ My issue : in PWSH constraint language mode, the import of ps1 files in forbidden.

So it's more a feature request than an issue : could you replace the call of autonomous ps1 files in the psd1 by a psm1 submodule that load the ps1 files ?

Thank you,

Kind regards,

Lucas Cueff

jazuntee commented 1 year ago

This is only one of several reasons this module will not currently work in constrained language mode. There is significant work required to support that.

MS-LUF commented 1 year ago

Hello, thanks for your feedback. From my point of view the work is not so huge because your code signing should cover 90 % of the constraint language mode limitations (forbidden type and so one). So the work is focused mainly on 3 files : the PSD1 to avoid any dot source call, the PSM1 to load all ps1 files as dot sourced files and export all function names based on function names imported. On my side, I have done a quick and dirty fix to test it and it is working well :

jazuntee commented 1 year ago

Alright, I'll leave this open. I do want to add a step in our publishing pipeline to combine everything into a single .psm1 file it just hasn't been a priority.