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 #1344

Closed
wants to merge 23 commits into from

Conversation

mdaneri
Copy link
Contributor

@mdaneri mdaneri commented Jun 27, 2024

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

@mdaneri
Copy link
Contributor Author

mdaneri commented Jun 27, 2024

Lock-PodeObject
Enter-PodeLockable
I'm not sure if are fixable passing an array the array is transformed to a different object

Maybe is better to set ValueFromPipeline to $false

@mdaneri mdaneri changed the title Enable Full Support for Passing Arrays to Functions Using Piping Support passing Arrays to Functions Using Piping Jul 11, 2024
@mdaneri
Copy link
Contributor Author

mdaneri commented Jul 19, 2024

@Badgerati, I am done with this. Please take a look at it when you have time

@mdaneri mdaneri closed this by deleting the head repository Sep 7, 2024
mdaneri added a commit to mdaneri/Pode that referenced this pull request Sep 8, 2024
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.

1 participant