小编Col*_*ake的帖子

将Powershell变量传递到scriptblock中

我正在尝试使用powershell变量并将它们应用于scriptblock.

param(
    [string]$username = $(throw "Blackberry Admin User Name is required"),
    [string]$password = $(throw "Blackberry Admin Password is required"),
    [string]$u = $(throw "Blackberry User Name is required")
    )

$s = New-PSSession -computerName bbbes01 
Invoke-Command -Session $s -Scriptblock {cd "C:\Program Files (x86)\Research In Motion\BlackBerry Enterprise Server Resource Kit\BlackBerry Enterprise Server User Administration Tool Client"
./BESUserAdminClient -username $username -password $password -ad_auth -domain staging -b bbbes -u $u -change -wrandom} -argumentlist $username $password $u
Run Code Online (Sandbox Code Playgroud)

我在跑步

.\ RandomActivationEmail.ps1 -username besadmin -password Pa $$ word …

powershell remoting blackberry

12
推荐指数
1
解决办法
2万
查看次数

标签 统计

blackberry ×1

powershell ×1

remoting ×1