相关疑难解决方法(0)

Powershell 参数

我的脚本中有一个 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 吗?如果不是,我能做些什么来确保我采用正确类型的变量类型,以便我可以将它传递给用户创建过程?

scripting powershell shell-scripting

10
推荐指数
1
解决办法
3万
查看次数

标签 统计

powershell ×1

scripting ×1

shell-scripting ×1