PowerShell / PowerShell/PSScriptAnalyzer

A rule to warn overwriting of built-in PowerShell cmdlets

Open
#1,023 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area - Rules Issue - Enhancement Issue - New Rule Up-for-Grabs
Dominant language
C#
Stars
2.2k
Forks
414
Avg merge
13h 1m
Merged PRs (30d)
2

Description

Summary of the new feature

See the issue we faced over in PSES:
https://github.com/PowerShell/PowerShellEditorServices/pull/686

MS Dynamics CRM redefines Set-Content which totally broke PSES.

We should have a rule that detects the overwriting/redefining of important built-in cmdlets to prevent these breaks from happening in future module development.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked PowerShell Editor Services pull request 686 and reviewing how PSScriptAnalyzer represents existing rules. Define which built-in cmdlets are important and how redefinitions should be detected; done means the rule reliably warns on those overwrites and has coverage for the reported Set-Content case.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.