我的脚本中有一个 Param 块
Param (
[Parameter(Mandatory=$True)]
[string]$FileLocation,
[Parameter(Mandatory=$True)]
[string]$password = Read-Host "Type the password you would like to set all the users to" -assecurestring
)
Run Code Online (Sandbox Code Playgroud)
我可以在必填的参数字段中使用 Read-Host CmdLet 吗?如果不是,我能做些什么来确保我采用正确类型的变量类型,以便我可以将它传递给用户创建过程?