Repository navigation
ScriptBlock.Invoke* code path has limited InvocationInfo #20500
Copy link
Copy link
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
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
Any scriptblock invoked via any of the *Invoke* code paths that lead to InvokeWithPipe end up creating a limited InvocationInfo (most notably missing CommandInfo).
{ $MyInvocation }.Invoke()Expected behavior
MyCommand : $MyInvocation
BoundParameters : {}
UnboundArguments : {}
ScriptLineNumber : 0
OffsetInLine : 0
HistoryId : 1
ScriptName :
Line : { $MyInvocation }.Invoke()
Statement : { $MyInvocation }.Invoke()
PositionMessage : At line:1 char:1
+ { $MyInvocation }.Invoke()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
PSScriptRoot :
PositionMessage :
PSScriptRoot :
PSCommandPath :
InvocationName :
PipelineLength : 0
PipelinePosition : 0
ExpectingInput : False
CommandOrigin : Internal
DisplayScriptPosition :Actual behavior
MyCommand :
BoundParameters : {}
UnboundArguments : {}
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 1
ScriptName :
Line : { $MyInvocation }.Invoke()
Statement : { $MyInvocation }.Invoke()
PositionMessage : At line:1 char:1
+ { $MyInvocation }.Invoke()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
PSScriptRoot :
PSCommandPath :
InvocationName :
PipelineLength : 0
PipelinePosition : 0
ExpectingInput : False
CommandOrigin : Internal
DisplayScriptPosition :Error details
No response
Environment data
Name Value
---- -----
PSVersion 7.4.0-preview.6
PSEdition Core
GitCommitId 7.4.0-preview.6
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
Activity
microsoft-github-policy-service commentedon Apr 14, 2024
This issue has not had any activity in 6 months, if there is no further activity in 7 days, the issue will be closed automatically.
Activity in this case refers only to comments on the issue. If the issue is closed and you are the author, you can re-open the issue using the button below. Please add more information to be considered during retriage. If you are not the author but the issue is impacting you after it has been closed, please submit a new issue with updated details and a link to this issue and the original.