【问题标题】:How do I ask for input in Powershell?如何在 Powershell 中请求输入?
【发布时间】:2022-10-24 14:22:10
【问题描述】:

我知道我可以在 Python 中使用input(),但我该如何在 Powershell 中使用呢?

我在回答我自己的问题

【问题讨论】:

    标签: powershell


    【解决方案1】:

    这很简单!只需使用 Read-Host 命令。例如:

    Read-Host "Input: "
    

    如果您想将其放入变量中,请执行以下操作:

    $input = Read-Host "Input: "
    

    【讨论】:

      猜你喜欢
      • 2012-06-23
      • 2022-11-11
      • 1970-01-01
      • 1970-01-01
      • 2018-01-11
      • 2016-04-21
      • 1970-01-01
      • 2019-06-20
      • 1970-01-01
      相关资源
      最近更新 更多