Closed raandree closed 1 year ago
When option WithYAML
is set to $true
the module powershell-yaml is installed. The module exports two commands where one (ConvertFrom-Yaml
) is used in build.ps1 to parse the default YAML or JSON build configuration file (or one passed thru the parameter BuildConfig
). The parsed configuration file will be used as the $BuildInfo
for tasks.
So if if I understamds the code correctly if leaving out WithYAML
so that powershell-yaml is not installed, and it is not installed in any PSModulePath the build should fail on missing the command ConvertFrom-Yaml
.
Then a workaround is to use a psd1 file as the configuration file instead. But that has probably never been tested. 🙂 So the root cause why it can't save the module should probably be found as it probably will have other consequences when Save-Module
fails.
No way I want to go back to psd1. But I don't even have to. Even when disabling WithYAML
the build works and I found the reason. I have created a new Sampler project and as you said, the build did not work:
ERROR: The specified module 'powershell-yaml' was not loaded because no valid module file was found in any module directory.
Build ABORTED D:\Git\T1\build.ps1. 0 tasks, 1 errors, 0 warnings 00:00:28.5413373
But when adding Datum
to the required modules which depends on powershell-yaml
, also powershell-yaml
is downloaded during the bootstrap process and things for.
So, @johlju, in this case, I guess I can disable WithYAML
, right?
Yes. Since powershell-yaml
is downloaded with Datum
and that happens prior to the build configuration file is read it should be safe to disable WithYML
. 🙂
Problem description
WithYAML
is enabled in CommonTasks since long time. For some reason, the build does no longer work and throwing this error:When disabling
WithYAML
inResolve-Dependency.psd1
, the build works again.WithYAML
?Verbose logs
How to reproduce
Build CommonTasks.
Expected behavior
No error.
Current behavior
see above.
Suggested solution
NA
Operating system the target node is running
PowerShell version and build the target node is running
Module version used