Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for functions to support complex expressions #1227

Closed
BernieWhite opened this issue Aug 16, 2022 · 0 comments · Fixed by #1368
Closed

Add initial support for functions to support complex expressions #1227

BernieWhite opened this issue Aug 16, 2022 · 0 comments · Fixed by #1368
Assignees
Labels
enhancement New feature or request feature: language Issues that affect language such keywords and variables
Milestone

Comments

@BernieWhite
Copy link
Member

BernieWhite commented Aug 16, 2022

PowerShell supports a wide range of language features which can be used within rules.

Currently rules and selectors written in YAML and JSON support expression conditions which are limited to comparison only.

We'd like to allow more complex rules to be built by extended the existing expressions support to add functions for basic manipulation.

This will support these features:


Updated

Currently supported functions:

  • boolean - Convert a value to a boolean.
  • string - Convert a value to a string.
  • integer - Convert a value to an integer.
  • concat - Concatenate multiple values.
  • substring - Extract a substring from a string.
  • configuration - Get a configuration value.
  • path - Get a value from an object path.

Functions to add:

  • replace
  • trim
  • first
  • split

See Azure/PSRule.Rules.Azure#1323

@BernieWhite BernieWhite added the enhancement New feature or request label Aug 16, 2022
@BernieWhite BernieWhite self-assigned this Aug 16, 2022
BernieWhite added a commit to BernieWhite/PSRule that referenced this issue Aug 16, 2022
BernieWhite added a commit to BernieWhite/PSRule that referenced this issue Aug 18, 2022
@BernieWhite BernieWhite changed the title Add initial support for expression functions to support complex expressions Add initial support for functions to support complex expressions Aug 25, 2022
@BernieWhite BernieWhite added the feature: language Issues that affect language such keywords and variables label Aug 25, 2022
@BernieWhite BernieWhite mentioned this issue Aug 29, 2022
4 tasks
@BernieWhite BernieWhite added this to the v2.6.0 milestone Oct 6, 2022
@BernieWhite BernieWhite modified the milestones: v2.6.0, v2.7.0 Nov 11, 2022
@BernieWhite BernieWhite modified the milestones: v2.7.0, v2.8.0 Nov 21, 2022
BernieWhite added a commit to BernieWhite/PSRule that referenced this issue Dec 5, 2022
@BernieWhite BernieWhite modified the milestones: v2.8.0, v2.7.0 Dec 5, 2022
@BernieWhite BernieWhite mentioned this issue Dec 24, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature: language Issues that affect language such keywords and variables
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant