How to use -InputObject switch for a command like stop-service?

Welcome Forums General PowerShell Q&A How to use -InputObject switch for a command like stop-service?

Viewing 1 reply thread
  • Author
    Posts
    • #263744
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      Hi all,

      I am trying to find examples to understand how to use “Stop-Service -InputObject …” and I can’t find anything about it?

      Can you please help me?

    • #263747
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      I found out:

      get-service -name *BITS* | Foreach-object {stop-service -InputObject $_}

      makes sense, as -InputObject accepts only <System.ServiceProcess.ServiceController[]> and “Accept pipeline input? True (ByValue)”

       

Viewing 1 reply thread
  • You must be logged in to reply to this topic.