我正在尝试从 TeamCity Windows Slave 运行 powershell 脚本到另一台服务器以部署我的应用程序。
这是构建配置:
username = "<username>"
$password = "<password>"
$secstr = New-Object -TypeName System.Security.SecureString;
$password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)}
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr;
Invoke-Command -ComputerName "<computer_name>" -Credential $cred -FilePath "deploy.ps1"
我收到以下错误。
following error message : Logon failure: unknown user name or bad password.
[13:57:52] [Step 1/1] For more information, see the about_Remote_Troubleshooting Help topic.
我只使用了正确的用户名和密码。我还检查了本地用户安全策略。我错过了什么吗?