Powershell-Read-Host Cmdlet

示例

在本例中,我们将要求用户传递一个输入并将输入保存到变量中。

$choice = Read-Host "Please put your choice"

Powershell将显示一个弹出窗口来输入值。输入值后,它将保存在$choice变量中。

打印变量choice:

$choice

Cmdlet

Read-Host cmdlet用于从控制台读取。

日期:2019-08-20 13:51:07 来源:oir作者:oir