📖 [Docs]: Coding standards put reuse before building (and .NET when you build)#18
Open
Marius Storhaug (MariusStorhaug) wants to merge 8 commits into
Open
📖 [Docs]: Coding standards put reuse before building (and .NET when you build)#18Marius Storhaug (MariusStorhaug) wants to merge 8 commits into
Marius Storhaug (MariusStorhaug) wants to merge 8 commits into
Conversation
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 5, 2026 15:03
View session
There was a problem hiding this comment.
Pull request overview
Updates the PowerShell coding standard to add an explicit, general “do the work in .NET” guideline, giving contributors a single, citable rule-of-thumb for choosing .NET APIs over cmdlet/pipeline usage on hot paths or where precision matters.
Changes:
- Adds a new “Do the work in .NET; use cmdlets to orchestrate it” bullet under Idioms and pitfalls.
- Frames the next two existing performance tips (avoid
Out-Null, avoid+=in loops) as specific applications of the new principle.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 6, 2026 06:45
View session
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 6, 2026 06:48
View session
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 6, 2026 06:51
View session
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 6, 2026 06:54
View session
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 6, 2026 06:59
View session
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 6, 2026 07:05
View session
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 6, 2026 07:07
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The coding standards now make the reuse decision explicit: before writing new logic, reach for what already exists — a language or runtime built-in, then an existing function, then a trusted dependency — and build it yourself only when nothing fits. The PowerShell idiom's ".NET" guidance is reframed to fit that order: .NET is what you reach for when you implement the work (or fix a slow internal function), not the first resort ahead of reusing a cmdlet or an existing function.
Changed: reuse comes before building
src/docs/Coding-Standards/Functions.mdgains a Reuse before you build section (language-agnostic — DRY and single responsibility applied across the whole codebase):Changed: PowerShell — reuse first, then reach for .NET
The "do the work in .NET" idiom in
src/docs/Coding-Standards/PowerShell/index.mdnow leads with the reuse order (built-in cmdlet/operator → module function →#Requires/RequiredModulesdependency → your own code) and links the baseline. The .NET specifics (hot-path calls,[void]/$null =, typed lists) remain for when you actually implement the work.Technical Details