You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a number of other related issues as summarized in the table below. Note that none of those issues are the same as this because of the following distinctions:
The issues in the table are only reproducible with Ctrl+C, and not by stopping a job. This issue is reproducible by stopping a job.
None of the issues below contemplate the scenario where execution has already entered clean{} when execution is interrupted. This issue is about interrupting execution in clean{}.
Name Value
---------
PSVersion 7.4.6
PSEdition Core
GitCommitId 7.4.6
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
A job that is stopped while it is executing
clean{}interrupts execution of thatclean{}block. This appears to contradict the documentationIt seems that when
StopProcessing()occurs whileclean{}is executing, resource cleanup is interrupted rather than enforced.Steps to reproduce
Expected output
perhaps with
mentioned.
Actual output
Related Issues
This issue arose from Provide a way to assign a returned object to a variable that is explicitly atomic when Stopping PowerShell #24658.
There are a number of other related issues as summarized in the table below. Note that none of those issues are the same as this because of the following distinctions:
clean{}when execution is interrupted. This issue is about interrupting execution inclean{}.repro 1.
Job.Stoppingrepro
Finallyblock isn't executed upon Ctrl+Cfinallycauses terminationfinallyfail with Ctrl+C andRead-HostNotes:
Write-Hoststatements, file redirections in afinallyblock intermittently fail quietly on Windows when Ctrl+C is used to terminate aRead-Hostcall #19987 seems to hinge onRead-Hostin a way that doesn't have an obvious analog in a job where there is no console.Environment data