更新时间:2022-04-16 03:52:59
如果您的脚本需要参数,Param
关键字必须是脚本中的第一条语句.
If your script requires arguments, the Param
keyword must be the first statement in the script.
但是,您可以稍后使用 Read-Host
cmdlet 要求用户输入:
However, you can ask the user for input later by using the Read-Host
cmdlet:
$processId = Read-Host "Enter the PID of the process to kill"