PowerShell / PowerShell/PSScriptAnalyzer
PSDSCStandardDSCFunctionsInResource
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 415
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
I have recently publish a couple of DSC Resource based modules to the gallery and they're being flagged by the following rule/error:
PSDSCStandardDSCFunctionsInResource Error VE_XD7WaitForSite.psm1 1 Missing 'Set-TargetResource' function. DSC Resource must implement Get, Set and Test-TargetResource functions.
The source for this particular module/error can be found here: https://github.com/VirtualEngine/XenDesktop7/tree/master/DSCResources/VE_XD7WaitForSite.
I assume it is because the .psm1 file doesn't contain the Get-, Test- and Set-TargetResource methods. In my instance, they're imported from a .ps1 file by the .psm1 file! Surely, this cannot be a hard-and-fast requirement?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the PSDSCStandardDSCFunctionsInResource rule and reproduce the report using the VE_XD7WaitForSite resource linked in the issue. Determine whether functions imported from the .psm1 file's .ps1 file should satisfy the rule; done means the valid resource is no longer flagged while resources genuinely missing Get-, Set-, or Test-TargetResource remain errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100