PSRule icon indicating copy to clipboard operation
PSRule copied to clipboard

Add initial support for functions to support complex expressions

Open BernieWhite opened this issue 3 years ago • 0 comments

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:

  • https://github.com/microsoft/PSRule/issues/1045
  • https://github.com/microsoft/PSRule/issues/1016

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

BernieWhite avatar Aug 16 '22 17:08 BernieWhite