-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
Resolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more
Description
Steps to reproduce
function a {
param( [Parameter(ValueFromPipeline)]$InputObject )
process {
try { $InputObject }
finally {
[console]::WriteLine('a finally')
[console]::WriteLine("a Stopping: $($PSCmdlet.Stopping)")
}
}
}
Add-Type '
using System;
using System.Management.Automation;
[Cmdlet("Invoke", "b")]
public class b : Cmdlet
{
[Parameter(ValueFromPipeline=true)]
public object InputObject { get; set; }
protected override void ProcessRecord()
{
WriteObject(InputObject,true);
}
protected override void StopProcessing()
{
Console.WriteLine("b StopProcessing");
Console.WriteLine("b Stopping: {0}",Stopping);
}
}' -PassThru | % Assembly | Import-Module
Set-Alias b Invoke-b
1 | a | b | % { sleep 10 } # press Ctrl-C here
Expected behavior
b StopProcessing
b Stopping: True
a finally
a Stopping: True
Actual behavior
b StopProcessing
b Stopping: True
a finally
a Stopping: False
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.0
PSEdition Core
GitCommitId v6.0.0
OS Microsoft Windows 6.3.9600
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Metadata
Metadata
Assignees
Labels
Resolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or more