Error in gm function?

  • PS D:\sql backup> function hello {"New Hello"}

    PS D:\sql backup> hello

    New Hello

    PS D:\sql backup> function gm {"Old Hello"}

    PS D:\sql backup> gm

    Get-Member : No object has been specified to the get-member cmdlet.

    At line:1 char:3

    + gm <<<<

    + CategoryInfo : CloseError: (:) [Get-Member], InvalidOperationException

    + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand

  • By default, the alias 'gm' is defined for the cmdlet Get-Member. You are trying to override the alias and you can't do that.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Oh thanks

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply