Skip to content

Adds wildcard support to -Variables & -Functions Parameters - #53

Merged
santisq merged 6 commits into
mainfrom
52-importvariables-importmodules-importfunctions
Jul 28, 2026
Merged

Adds wildcard support to -Variables & -Functions Parameters#53
santisq merged 6 commits into
mainfrom
52-importvariables-importmodules-importfunctions

Conversation

@santisq

@santisq santisq commented Jul 28, 2026

Copy link
Copy Markdown
Owner

What's Changed

Features & Enhancements

  • Wildcard support for -Variables and -Functions: Both parameters now accept string patterns with wildcards (e.g., *, foo*, [ab]*) to dynamically import matching items from the caller's scope into the parallel scope.
    • Example: -Variables * imports all non-built-in variables, or -Variables foo* imports only variables starting with foo.
    • Example: -Functions Get-* defines all Get- functions in the parallel scope.

Note

When resolving variables via string patterns, variables whose values are of type ScriptBlock are silently ignored. Explicitly passing script blocks via hashtable like -Variables @{ foo = { ... } } retains its existing behavior.

  • Support for multiple dictionaries in -Variables: Updated parameter type from Hashtable to IDictionary[], allowing multiple dictionaries to be passed as arguments. Duplicate keys are automatically ignored.

Behavior & Breaking Changes

  • Terminating error for unmatched variables: -Variables now throws a terminating error (ItemNotFoundException) if a specified variable name or wildcard pattern fails to match any variable in the caller's scope (aligning with the existing behavior of -Functions).

Refactoring

  • Major internal refactoring to simplify code structure and improve overall readability.

@santisq santisq self-assigned this Jul 28, 2026
@santisq santisq added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 28, 2026
@santisq santisq linked an issue Jul 28, 2026 that may be closed by this pull request
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.56098% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.11%. Comparing base (47c6d69) to head (c6ead2f).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/PSParallelPipeline/ExceptionExtensions.cs 90.62% 6 Missing ⚠️
src/PSParallelPipeline/MiscExtensions.cs 99.42% 0 Missing and 1 partial ⚠️
src/PSParallelPipeline/VariableTransformation.cs 97.43% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #53      +/-   ##
==========================================
+ Coverage   97.96%   98.11%   +0.14%     
==========================================
  Files          12       13       +1     
  Lines         590      583       -7     
  Branches       43       55      +12     
==========================================
- Hits          578      572       -6     
- Misses          7        8       +1     
+ Partials        5        3       -2     
Flag Coverage Δ
PS-5.1 97.94% <97.56%> (-0.46%) ⬇️
PS-7_Linux 98.11% <97.56%> (+0.14%) ⬆️
PS-7_Windows 98.11% <97.56%> (-0.29%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@santisq
santisq merged commit fe15f4d into main Jul 28, 2026
9 of 12 checks passed
@santisq
santisq deleted the 52-importvariables-importmodules-importfunctions branch July 28, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-ImportVariables/-ImportModules/-ImportFunctions

1 participant