-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Get-Command doesn't properly recognize System.Management.Automation.CommandInfo (its own output type) as pipeline input #11017
Copy link
Copy link
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module
Description
#10851 reported that feeding Get-Command output to itself via the pipeline - useful if you want to force loading of all modules in the context of reflection, for instance - doesn't work as expected.
#10929 tried to fix that, but fell short.
Steps to reproduce
function foo {}; set-alias foo foo
(gcm -all foo | gcm).Count | Should -Be 2
(gcm -all foo | gcm).ComandType | Should -Be Alias, FunctionExpected behavior
The tests should succeed.
Actual behavior
The tests fail:
Expected 2, but got 278 # *all* commands are returned
Expected @('Alias', 'Function'), but got $null
Environment data
PowerShell Core 7.0.0-preview.5, with PR #10929 applied
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module