Skip to content

Feat: pwsh 7.6 - #944

Draft
Zacgoose wants to merge 2 commits into
devfrom
feat/pwsh-7.6
Draft

Zacgoose wants to merge 2 commits into
devfrom
feat/pwsh-7.6

Conversation

@Zacgoose

Copy link
Copy Markdown
Contributor

This pull request introduces improved cancellation support for HTTP requests and concurrent operations throughout the codebase, ensuring that long-running or stalled operations can be reliably aborted when required (such as when a pipeline is stopped). It also updates Docker build images to use the latest .NET 10.0 SDK. The most important changes are grouped below:

Enhanced Cancellation Support

  • Updated the CIPPRestClient methods (Send, SendAsync, SendConcurrent, SendConcurrentAsync, and internal helpers) to accept and propagate a CancellationToken, allowing external cancellation of HTTP requests and concurrent operations. This ensures that requests can be stopped cleanly and promptly when requested by the caller. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Updated all PowerShell cmdlets and functions that invoke CIPPRestClient methods to pass the pipeline's cancellation token ($PSCmdlet.PipelineStopToken). This ensures that user-initiated or pipeline-triggered cancellations are respected at every level. [1] [2] [3] [4] [5] [6]
  • Improved resource cleanup in streaming download functions by registering disposal of HTTP clients with the pipeline's cancellation token, ensuring that stalled downloads are aborted and resources are released when the pipeline is stopped. [1] [2] [3] [4]

Testing

  • Added a new test script CIPPRestClient.Cancellation.Tests.ps1 to verify that cancellation tokens correctly abort HTTP requests and concurrent operations, and that timeouts are still handled as expected.

Build Environment Updates

  • Updated Dockerfiles to use the .NET 10.0 SDK (dotnet/sdk:10.0-noble) instead of 8.0, ensuring compatibility with the latest .NET features and improvements. [1] [2] [3] [4]

- CIPPRestClient Send/SendConcurrent take the caller's cancellation token
- callers pass $PSCmdlet.PipelineStopToken (PS 7.6; null on 7.4)
- report export downloads dispose their HttpClient on stop
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