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

Support passing Arrays to Functions Using Piping #1388

Merged
merged 14 commits into from
Sep 28, 2024

Conversation

mdaneri
Copy link
Contributor

@mdaneri mdaneri commented Sep 8, 2024

recovered from Support passing Arrays to Functions Using Piping #1344

Description

This feature enhances the Pode module by enabling full support for passing arrays to functions using the pipeline. The update ensures that the specified functions can correctly handle multiple input objects when piped as arrays, improving flexibility and usability in scripting and automation.

Impacted Functions:

  • Set-PodeCache
  • Add-PodeOAResponse
  • Remove-PodeOAResponse
  • Set-PodeOARequest
  • Set-PodeOARouteInfo
  • Add-PodeOACallBack
  • Add-PodeOAExternalRoute
  • ConvertTo-PodeRoute
  • Update-PodeSecret
  • Set-PodeSecret
  • Set-PodeState
  • Out-PodeHost
  • Write-PodeHost
  • Out-PodeVariable

Key Changes:

  • Modified the impacted functions to support array input via the pipeline.
  • Enhanced processing logic to aggregate piped values and handle them appropriately.
  • Ensured backward compatibility by retaining existing parameter functionalities.

This update will streamline the process of handling multiple objects in a single pipeline, making it easier to work with collections of items in Pode scripts.

This update address #1343

src/Public/Tasks.ps1 Fixed Show fixed Hide fixed
Copy link
Owner

@Badgerati Badgerati left a comment

Choose a reason for hiding this comment

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

I've reviewed some, but two comments reference examples where we could simplify further by just removing all unneeded ValueFromPipeline attributes from Private functions - doing this for quite a few of the functions will reduce a lot of the changes as they wouldn't be needed.

src/Private/Helpers.ps1 Outdated Show resolved Hide resolved
src/Private/Helpers.ps1 Outdated Show resolved Hide resolved
src/Private/Helpers.ps1 Show resolved Hide resolved
src/Private/Responses.ps1 Outdated Show resolved Hide resolved
src/Private/Helpers.ps1 Outdated Show resolved Hide resolved
src/Public/SSE.ps1 Outdated Show resolved Hide resolved
src/Public/Secrets.ps1 Outdated Show resolved Hide resolved
src/Public/Secrets.ps1 Outdated Show resolved Hide resolved
src/Public/Utilities.ps1 Show resolved Hide resolved
src/Private/Helpers.ps1 Dismissed Show dismissed Hide dismissed
@Badgerati Badgerati added this to the 2.11.0 milestone Sep 28, 2024
@Badgerati Badgerati merged commit af57434 into Badgerati:develop Sep 28, 2024
14 checks passed
@Badgerati Badgerati linked an issue Sep 28, 2024 that may be closed by this pull request
@Badgerati Badgerati mentioned this pull request Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set-PodeCache not working as expected with piped array
2 participants