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
    • #193496
      Topics: 1
      Replies: 0
      Points: 11
      Rank: Member


      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
      Topics: 5
      Replies: 106
      Points: 273
      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
      Topics: 5
      Replies: 237
      Points: 1,321
      Helping Hand
      Rank: Community Hero

      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
      Topics: 32
      Replies: 842
      Points: 2,689
      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
  • The topic ‘how to pass YES with Invoke-Command’ is closed to new replies.