How do I automatically answer “yes” to a prompt in Powershell?

后端 未结 5 1705
旧时难觅i
旧时难觅i 2020-12-16 13:53

How can I input \"yes\" as an answer to an interactive question in a PowerShell session? I know, in Bash, Yes is the tool to answer \"yes\" on the prompt. In my

5条回答
  •  一生所求
    2020-12-16 14:05

    Inspired by other answers, here is my example:

    ECHO Y | powershell Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
    

提交回复
热议问题