Feeding Get-Command output to itself via the pipeline - useful if you want to force loading of all modules in the context of reflection - doesn't work as expected.
It looks like a new parameter set with a System.Management.Automation.CommandInfo-typed parameter would have to be introduced to support that.
Steps to reproduce
# OK
('Add-Content', 'Get-Content' | Get-Command).Name | Should -Be 'Add-Content', 'Get-Content'
# Fails
(Get-Command 'Add-Content', 'Get-Content' | Get-Command).Name | Should -Be 'Add-Content', 'Get-Content'
Expected behavior
Both tests should succeed.
Actual behavior
The 2nd test fails, because the only CommandInfo object output is the one for Add-Content
Expected @('Add-Content', 'Get-Content'), but got 'Add-Content'
Environment data
PowerShell Core 7.0.0-preview.4
Feeding
Get-Commandoutput to itself via the pipeline - useful if you want to force loading of all modules in the context of reflection - doesn't work as expected.It looks like a new parameter set with a
System.Management.Automation.CommandInfo-typed parameter would have to be introduced to support that.Steps to reproduce
Expected behavior
Both tests should succeed.
Actual behavior
The 2nd test fails, because the only
CommandInfoobject output is the one forAdd-ContentEnvironment data