RamblingCookieMonster / BuildHelpers

Helper functions for PowerShell CI/CD scenarios
MIT License
214 stars 47 forks source link

Set-ModuleFinctions Error Handling Enhancment #97

Open Dejulia489 opened 5 years ago

Dejulia489 commented 5 years ago

Set-ModuleFunctions does not return the error from the $Powershell.Invoke on line 59.

jonathanmedd commented 3 years ago

Is there a possibility to get the linked PR merged?

I had an issue with Set-ModuleFunction in a build and the error thrown as the code currently is suggests an issue with the file path to the module, when in fact it's most likely something completely different, example below:

Exception: Could not find module 'D:\a\1\s\src\Brickset.psd1'

When using the code suggested in the PR, the actual issue is returned during the build:

Exception: The version of Windows PowerShell on this computer is '5.1.17763.1490'. The module 'D:\a\1\s\src\Brickset.psd1' requires a minimum Windows PowerShell version of '7.1' to run. Verify that you have the minimum required version of Windows PowerShell installed, and then try again