how to pass YES with Invoke-Command

Welcome Forums General PowerShell Q&A how to pass YES with Invoke-Command

Viewing 3 reply threads
  • Author
    Posts
    • #193496
      Participant
      Topics: 1
      Replies: 0
      Points: 11
      Rank: Member

      hi

      i want to run a command on multiple servers using Invoke-Command

      the problems is that if a command need an answer like YES or YES TO ALL

      i must click on it for it to finish

      is there any way to automate this ?

    • #193511
      Participant
      Topics: 5
      Replies: 105
      Points: 262
      Helping Hand
      Rank: Contributor

      So what are you invoking? Is it creating a pop-up gui or is the confirmation printed to console? Can you add silent parameter or confirm:$false?

    • #193565
      Moderator
      Topics: 3
      Replies: 169
      Points: 889
      Helping Hand
      Rank: Major Contributor

      Ideally, CmdLets ask for confirmation if they are critical, and if you know the impact then check to see if it supports -Force parameter, with -Force parameter it will not ask for the confirmation.

    • #193748
      js
      Participant
      Topics: 27
      Replies: 739
      Points: 2,013
      Helping Hand
      Rank: Community Hero

      Which command is it? Sometimes you can pipe 'y' or 'yes' to it, or it has a '/y' option.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.