Powershell -Confirm

Welcome Forums General PowerShell Q&A Powershell -Confirm

Viewing 2 reply threads
  • Author
    Posts
    • #272986
      Participant
      Topics: 40
      Replies: 119
      Points: 646
      Rank: Major Contributor

      I have a small script that I need to run stand alone and it prompts me for a response.

      I added -confirm:$false but it still prompts me what am I doing wrong here?

      When I run the script

      If the file exists then rename it otherwise continue  and no prompt

       

      Thank you

       

      Tom

      • This topic was modified 5 days, 23 hours ago by kvprasoon. Reason: code formatting https://powershell.org/forums/topic/where-are-all-my-posts-over-the-years/
    • #272998
      Participant
      Topics: 16
      Replies: 1842
      Points: 3,514
      Helping Hand
      Rank: Community Hero

      It’s telling you that there are children (e.g. folders\files) under that directory and telling you:

      and the Recurse parameter was not specified.

      Add the -Recurse parameter:

    • #273019
      Participant
      Topics: 40
      Replies: 119
      Points: 646
      Rank: Major Contributor

      Rob

       

      Thanks that worked.

Viewing 2 reply threads
  • The topic ‘Powershell -Confirm’ is closed to new replies.