Skip to content

Get-PSCallStack's Arguments script property contains no useful information #11208

@mklement0

Description

@mklement0

The .Arguments property on the System.Management.Automation.CallStackFrame instances output by Get-PSCallStack is a script property that - I presume - is meant to reflect the arguments passed.

The property isn't documented, but it seems to contain no useful information, seemingly containing $null in any non-global scope.

While you con obtain argument information via the type-native .InvocationInfo property, I assume there is a purpose to .Arguments that it currently doesn't fulfill.

Steps to reproduce

& { (Get-PSCallStack)[0].Arguments } 'foo'  | Should -match 'foo'

Expected behavior

The test should pass.

Actual behavior

The test fails, because .Arguments is $null:

Expected regular expression 'foo' to match $null, but it did not match.

Environment data

PowerShell Core 7.0.0-preview.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions