-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
With a PowerShell module installed that contain PowerShell based cmdlets (functions).
E.g. the function Copy-ObjectGraph of the ObjectGraphTools module.
It appears that not all properties load when the commands are retrieved via a wide filter:
Steps to reproduce:
- Open a new PowerShell session and run the following commands:
$CommandName = 'Copy-ObjectGraph'
$Command = Get-Command * | Where-Object Name -eq $CommandName
$Command.ScriptBlockExpected to return the command's ScriptBlock but returns nothing
Yet, this is works fine:
$Command = Get-Command $CommandName
$Command.ScriptBlockAnd now the first command set also appears to work...
Expected behavior
Expected to return the command's ScriptBlockActual behavior
Returns nothingError details
Environment data
Name Value
---- -----
PSVersion 7.5.2
PSEdition Core
GitCommitId 7.5.2
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response
Metadata
Metadata
Assignees
Labels
No labels