![](/img/trans.png)
[英]Storing credentials to run PowerShell script in PHP application (remotely)
[英]Run an Application form Powershell with Credentials
我正在使用Invoke-Item
命令来启动应用程序。 当我运行它时,它会提示输入用户名和密码。 我想通过PowerShell
自动填充,这可以实现吗?
您可以使用带有PSCredential object
的[-Credential <PSCredential>]
参数来执行此操作:
# Edit your creds here
$user = "Domain\Username"
$password = ConvertTo-SecureString "MyPassword" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ($user, $password)
Invoke-Item "Your Application" -Credential $mycreds
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.