Comments (8)
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.
I'll hold this issue open until we hear some more information around why this behavior is required.
from certificatedsc.
@PlagueHO I've not tried it, but would putting $PSDefaultParameterValues['Verbose'] = $VerbosePreference
at the top of each *-TargetResource method/begin block work?
from certificatedsc.
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.
@PlagueHO I agree that they are all workarounds, but I don't see this being "fixed" outside of PowerShell 6.0
from certificatedsc.
@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.
@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.
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)
- Rename master branch to main
- Test-TargetResource fails if server language is not English (Get-CertificateTemplateInformation) HOT 1
- PfxImport & CertificateImport: Add base64 content parameter for PFX and certificate import resources HOT 6
- Remove non-mandatory parameters from Get-TargetResource
- Update GitVersion.yml to use latest pattern
- INF file format is wrong HOT 1
- DSC_PfxImport:'Import-PfxCertificateEx' function handles private keys differently then 'Import-PfxCertificate' cmdlet HOT 3
- Tests failing: New-SelfSignedCertificateEx from Script Center is no longer available
- Update Sampler Build Tasks
- Enable Code Coverage Reporting
- PfxImport: Cannot find an overload for "Import" and the argument count: "2" HOT 1
- PfxImport: Keys prevent multiple imports to different locations HOT 1
- When using content option on PfxImport with certificate twice in pfx private key gets lost HOT 1
- Update Azure DevOps Pipeline Images
- Update CI Pipeline Files from Latest Pattern
- Convert to class-based resources
- Convert tests to Pester 5
- Add support to export Cert as Base64 with CredentialExport HOT 2
- CertReq resource cannot request multiple certificates with same subject name HOT 2
- DSC_CertReq failed to execute Set-TargetResource functionality with error message: Cannot add type. The type name 'Source.NativeMethods' already exists
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from certificatedsc.