How to use/read "cmdlet | gm" Definition

This topic contains 2 replies, has 3 voices, and was last updated by Profile photo of Don Jones Don Jones 1 week, 1 day ago.

  • Author
    Posts
  • #58760
    Profile photo of Miroslav
    Miroslav
    Participant

    Hello,

    I'm lacking some fundamental knowledge of how use of the info places in the brackets in objects methods and properties.
    When I execute "Get-Service bits | gm" i can see:
    Start Method void Start(), void Start(string[] args)
    DisplayName Property string DisplayName {get;set;}

    How to find info what arguments I can use in "Start(string[] args)"?
    Also "DisplayName {get;set;}", how to use 'set' and does it really can set different display name?

    I tried to explore MSDN documentation for System.ServiceProcess.ServiceController but still didn't find the answer.

    I would be really thankful if you can appoint me to some helpful resources.

  • #58771
    Profile photo of Daan Weda
    Daan Weda
    Participant

    I don't know what your exact goal is?
    But it seems to me that if you want to change for example the displayname of a service you could use the cmdlet set-service for that.

    (Get-Service "BITS")|Set-Service -DisplayName "What ever you like"

    I think this article is a good starting point:

  • #58772
    Profile photo of Don Jones
    Don Jones
    Keymaster

    How to find info what arguments I can use in "Start(string[] args)"?
    Also "DisplayName {get;set;}", how to use 'set' and does it really can set different display name?

    You'd have to read the documentation for the arguments a method wants. MSDN might not be wonderful, but it's the right place to go for that.

    Just because a property has a getter and a setter doesn't necessarily mean both are "wired up" under the hood. Unfortunately, .NET isn't always consistent about that.

You must be logged in to reply to this topic.