我正在尝试使用powershell在远程服务器上安装应用程序。下面是我使用的脚本:
$Username = 'administrator'
$Password = 'Password'
$pass = ConvertTo-SecureString -AsPlainText $Password -Force
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass
Invoke-Command -ComputerName "IP" -ScriptBlock {Start-Process -FilePath `"C:\Windows\notepad.exe" `} -credential $Cred
1条答案
按热度按时间nhaq1z211#
我无法选择会话号,您只能运行会话0。