Open bls-droid opened 1 year ago
Hi and thanks for reporting this. I have not seen this error so far.
One thing that jumps into my eyes is the path for calling the script. When you call the script directory, do you really use .\C:\BuildWorker1\_work\2\s\build.ps1
or C:\BuildWorker1\_work\2\s\build.ps1
? Having a .\
at the beginning of the path does not work for me at all.
You get the error C:\BuildWorker1\_work\2\s\Resolve-Dependency.psd1': The file 'C:\BuildWorker1\_work\2\s\Resolve-Dependency.psd1' could not be parsed as a PowerShell Data File```. How does the file
Resolve-Dependency.psd1` look like. Does it show any data corruption?
I tried it again and it does not work with .\ form. Resolve-Dependency.psd1 - had a double line: ( AllowOldPowerShellGetModule = $true ) Not sure if I got that in there somehow but it wasn't present in the copy I setup on the lab host, structure of file there looks quite different. After removing the duplicate line it no longer lists the "could not be parsed..." error but pipeline still fails with the module not found error.
I think I see what's causing it: the versions in the RequiredModules.psd1 don't match what's available in the local nuget feed. ResolveDependency.psd1 pins it to only use the local one, whereas running from pshell falls back to PSGallery.
I was able to match the versions to what's available in local feed and it eliminates the errors, but now it's missing ( 'DscConfig.Demo' = '0.8.1-preview0002'). I will need to figure out how to add it.
Problem description
Hello, I am running the lab deployment with local Hyper-v AzureDevOps scenario, based on Server 2022, Azure Devops Server 2022 and SQL server 2019. When running the Devops pipeline I get a failure at the Build DSC Artifacts stage. I included the log at the bottom. When I run the same cmd ( C:\BuildWorker1_work\2\s> .\build.ps1 -ResolveDependency -tasks build ) in a powershell window directly on the buildworker machine, I still get the same errors but the build finishes and generates the artifacts. One additional message I see in the direct execute in powershell is this one.
Verbose logs
Log snipped from the AzureDevops pipeline:
Console output from the direct execution on the buildworker machine.
How to reproduce
Clone DscWorkshop project and deploy the hyper-v lab using the scripts in the Lab folder of the project. In AzureDevops, when I try run the DscWorkshop pipeline, it fails with the error detailed above.
Expected behavior
Pipeline complete building the artifacts
Current behavior
Pipeline fails at build dsc artifacts step.
Suggested solution
I don't have one.
Operating system the target node is running
PowerShell version and build the target node is running
Module version used