Skip to content

Conversation

SteveL-MSFT
Copy link
Member

PR Summary

Implement all the remaining logical functions: and(), bool(), false(), true(), not(), or()

PR Context

Part of #976

@SteveL-MSFT SteveL-MSFT requested review from tgauth and Copilot July 17, 2025 23:15
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements six remaining logical functions for the DSC function library: and(), bool(), false(), true(), not(), and or(). These functions provide essential boolean operations and type conversions to support logical expressions in DSC configurations.

  • Adds logical operators (and, or, not) that accept boolean arguments and perform standard logical operations
  • Adds boolean constants (true, false) that return fixed boolean values without arguments
  • Adds a type conversion function (bool) that converts strings and numbers to boolean values
  • Updates module registration and localization to support all new functions
  • Includes comprehensive test coverage for all implemented functions

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
dsc_lib/src/functions/and.rs Implements logical AND function with support for multiple boolean arguments
dsc_lib/src/functions/or.rs Implements logical OR function with support for multiple boolean arguments
dsc_lib/src/functions/not.rs Implements logical NOT function for single boolean argument
dsc_lib/src/functions/bool.rs Implements boolean conversion from strings ("true"/"false") and numbers (0/non-zero)
dsc_lib/src/functions/true.rs Implements constant function returning boolean true
dsc_lib/src/functions/false.rs Implements constant function returning boolean false
dsc_lib/src/functions/mod.rs Registers all new logical functions in the function dispatcher
dsc_lib/locales/en-us.toml Adds localized descriptions and messages for all new functions
dsc/tests/dsc_expressions.tests.ps1 Adds comprehensive integration tests for all logical functions

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Jul 18, 2025
Merged via the queue into PowerShell:main with commit c1b98e1 Jul 18, 2025
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the logical-functions branch July 18, 2025 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants