Skip to content

Get-PokeMember 'a' throw exception #5

@vors

Description

@vors

Get-PokeMember seems like a useful function.

# shortcut for $o | peek | gm
function Get-PokeMember { $input | peek | Get-Member }

I thought it can be used like this: Get-PokeMember 'a'

> Get-PokeMember 'a'
New-InstanceProxy : Cannot validate argument on parameter 'Instance'. The argument is null. Provide a valid value for 
the argument, and then try running the command again.
At D:\dev\poke\Poke.psm1:866 char:41
+             New-InstanceProxy -Instance $InputObject
+                                         ~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [New-InstanceProxy], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,New-InstanceProxy

Get-Member : You must specify an object for the Get-Member cmdlet.
At D:\dev\poke\Poke.psm1:930 char:43
+ function Get-PokeMember { $input | peek | Get-Member }
+                                           ~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-Member], InvalidOperationException
    + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions