Code Monkey home page Code Monkey logo

Comments (9)

BladeFireLight avatar BladeFireLight commented on August 12, 2024

Tried it with no modules and a blank config and got the same error importing that module.

I know it happens with other modules to.

from dsc.

BladeFireLight avatar BladeFireLight commented on August 12, 2024

I tracked it down to this line in DSC\Development
Get-DscResorcesVersion.ps1
line 19 in Get-ModuleVersion
$Version = (Invoke-Expression -Command $psd1)['ModuleVersion']

from dsc.

dlwyatt avatar dlwyatt commented on August 12, 2024

Invoke-Expression is evil. :\ Thanks for tracking this down. I'll see if I can reproduce this and fix the code tomorrow, if no one else has already done it.

from dsc.

BladeFireLight avatar BladeFireLight commented on August 12, 2024

It would seem that if the PSD1 is signed (one of mine were) it's guaranteed to bug out on that line. In an "all signed" environment I'm not sure if the psd1's need a signature block, but as I place files back into resources, tools and configuration it breaks again.
so once item at a time i will see if I can find any other causes.

from dsc.

BladeFireLight avatar BladeFireLight commented on August 12, 2024

If DscOperations is in the DSC_Tooling folder it bugs out at the same invoke-expression when Publish-DscToolModule runs.
There is no signature block involved this time.

from dsc.

smurawski avatar smurawski commented on August 12, 2024

Just a couple of comments.. due to issues with resource caching (before debugmode in PS5), Invoke-DscBuild was intended to run inside a shared powershell session (it's not really documented, which is my bad) - I always launched it in a job. As noted, it was never tested with signed modules. There is probably a better way to get the module version (like get-module at the path), but iex was the most convenient at the time.

from dsc.

BladeFireLight avatar BladeFireLight commented on August 12, 2024

I'm not sure if psd1 are supposed to be signed. The files in question were signed by targeting a every Ps* in a set of folders.

I figured Invoke-DscBuild was designed to run in a new instance of PowerShell. That is why I have been working around the issue thus far. The new process check version before invoking pester though a monkey ranch into it and I finally had to get to the root of the issue. Its running quite well now that I can avoid triggering the issue. I look forward to a what the community can hammerout address the issue.

Thanks Steven, and everyone else who contributed, for all the hard work and putting this out there. I can imagine the mess I would be dealing with trying to manage 3000 nodes with a monolithic DSC config.

from dsc.

dlwyatt avatar dlwyatt commented on August 12, 2024

OK, I was able to reproduce this tonight, though it was working fine at first; not sure what finally triggered the bug. Once it started happening, though, it was consistent even in new PowerShell sessions.

I've updated the DscBuild module in the development branch so it no longer calls Invoke-Expression when importing PSD1 files, and that cleared up the problem on my test VM. Please let me know if it does the same for you.

from dsc.

BladeFireLight avatar BladeFireLight commented on August 12, 2024

Works like a charm with both the signature and having DscOperations in DSC_Tooling.

Thank you Dave.

from dsc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.