Giter Site home page Giter Site logo

Comments (8)

johlju avatar johlju commented on June 1, 2024 1

There not a better solution and probably wonโ€™t be for MOF resources. Either add -Verbose to Write-Verbose calls. Or add -Verbose to the call of the helper function.

from certificatedsc.

PlagueHO avatar PlagueHO commented on June 1, 2024

I'll hold this issue open until we hear some more information around why this behavior is required.

from certificatedsc.

iainbrighton avatar iainbrighton commented on June 1, 2024

@PlagueHO I've not tried it, but would putting $PSDefaultParameterValues['Verbose'] = $VerbosePreference at the top of each *-TargetResource method/begin block work?

from certificatedsc.

PlagueHO avatar PlagueHO commented on June 1, 2024

Hi @iainbrighton - I suspect your solution would work well. My only issue with all solutions so far is that they feel like work arounds to something that I think should behave differently. If -Verbose is set in a call then it should get passed down through any subsequent calls. This does happen except when control is passed to another module (e.g. scope changes).

from certificatedsc.

iainbrighton avatar iainbrighton commented on June 1, 2024

@PlagueHO I agree that they are all workarounds, but I don't see this being "fixed" outside of PowerShell 6.0 ๐Ÿ˜ข. It could just be that I'm a pessimist!

from certificatedsc.

PlagueHO avatar PlagueHO commented on June 1, 2024

@iainbrighton - haha yes, that is pretty pessimistic, but I tend to agree with you. I am just hopeful that there is something I'm doing wrong somewhere and there is some "official" solution to this.

@johlju - what do you reckon?

from certificatedsc.

johlju avatar johlju commented on June 1, 2024

@iainbrighton Might be so, but rather not quick fix this by changing all of the resources. But if we could use the same approach to switch it once in the helper module I would go for that, instead of adding -Verbose to each Write-Verbose in the helper module.

Are we thinking that this is a bug, then maybe we should submit a uservoice for it, to raise the question? If the resource imports the module, is should be in the same scope, and should just pass the VerbosePreference along.

from certificatedsc.

bailsman avatar bailsman commented on June 1, 2024

Hi - found this issue from Google. My own helper functions in my own DSC modules are also not printing verbose messages.

Just curious if you have found a better solution to this in the meantime? Or is adding -Verbose to your Write-Verbose calls in the helper module the accepted workaround?

from certificatedsc.

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.