dsccommunity / dsccommunity/SharePointDsc
Implement usage of Strict Mode in resources
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 246
- Forks
- 106
- PR merge metrics
- No merged PRs in 30d
Description
I think we should add Set-StrictMode with either version 1 or 2 to resources. This will make it easier to discover usage of uninitialized variables, references to non-existent properties of an object, function calls that use the syntax for calling methods, and variable without a name.
I have seen issues in some of the resources that possibly would have been discovered by setting strict mode.
Strict Mode will help increase the quality of the scripts.
Here is some more information: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/set-strictmode
https://blogs.technet.microsoft.com/heyscriptingguy/2014/12/03/enforce-better-script-practices-by-using-set-strictmode/
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
Review the SharePointDsc PowerShell resources and the linked Set-StrictMode documentation first. Determine whether version 1 or 2 is appropriate and how strict mode should be applied across the resources. Done means the resources consistently use strict mode and the resulting uninitialized-variable or invalid-reference issues are addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- devops
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100