Open kungfoome opened 5 years ago
This looks OK to me (needs style corrections though 😁 I can't help see HQRM violations anymore! 😢 ).
@PlagueHO lol thats fine. I'm still getting used to PowerShell styling as this is my first time working on anything PowerShell related at this capacity.
Can we get this snippet as an example in the existing template resource? 🤔 Not sure where we should add best practices like this? Style Guideline in DscResources repo
I ran into an issue working on another resource passing mandatory parameters to get-target. See here https://github.com/PowerShell/DscResource.Template/blob/2cc2000bfe83bffc9dafea0e61385a659e5815ae/DSCResources/MSFT_ResourceName/MSFT_ResourceName.psm1#L107
This is fine, but the problem is when you have parameters needed for get-target, but they are not mandatory to pass in. An example may be Credential. I may not need a credential to be a mandatory parameter, but I need to pass it to get-target.
I came up with something like this: