PowerShell / PowerShell/PowerShell

Add [math] to ConstrainedLanguage mode

Open
#24,916 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Enhancement Needs-Triage WG-Security
Dominant language
C#
Stars
55.5k
Forks
8.5k
Avg merge
1d 2h
Merged PRs (30d)
88

Description

Summary of the new feature / enhancement

I'm not entirely sure why [math] was left out of ConstrainedLanguage mode, but [math] would still be useful for operations like [math]::Ceiling().

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7.5#constrainedlanguage-mode

  • Types like [regex] are allowed, so I can't think of a reason that [math] would not be.
Proposed technical implementation details (optional)

Include it as one of the allowed types.

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 with the linked about_language_modes documentation, then locate the ConstrainedLanguage implementation that defines allowed types. Add [math] to that allowed set and verify that calls such as [math]::Ceiling() work in ConstrainedLanguage mode without broadening access beyond the requested type.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.