【发布时间】:2017-10-22 04:27:56
【问题描述】:
我在 TFS 中有一个包含 2 个任务的发布定义。其中一个完美通过,而另一个抛出异常,尽管两者的配置非常相似。
任务配置成功:
CopyFile Task
Source: $(System.DefaultWorkingDirectory)/XXX Build Definition/drop
Machines $(WebServers)
Admin Login: server\user
Password: Password
Protocol: HTTP
Destination Folder: C:\DestFolder
Variables: WebServers: MyServer
失败的任务配置:
RunPowerShellOnRemoteComputer Task
Machines $(WebServers)
Admin Login: server\user
Password: Password
Protocol: HTTP
PowerShell Script: C:\...\script.ps1
Variables: WebServers: MyServer
在运行第二个任务时,我收到此异常:
使用“2”参数调用“SetRight”的异常:“无法获得 用户信息。” CategoryInfo :NotSpecified: (:) [], MethodInvocationException FullyQualifiedErrorId :Exception ---> System.Management.Automation.RemoteException:异常调用 带有“2”个参数的“SetRight”:“无法获取用户 信息。” --- 内部异常堆栈跟踪结束 --- 在 Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.PowershellExecutor.Invoke(字符串 errorContextMessage, Boolean writeResultToLog, Boolean isCancellable) 在 Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.InstallServiceInternal(字符串 serviceSourcePath,字符串 serviceName,字符串destinationFileName) 在 Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.InstallService(字符串 serviceSourcePath,字符串 serviceName,字符串destinationFileName) 在 Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.DeploymentClient.d__24.MoveNext() --->(内部异常 #0)System.Management.Automation.RemoteException:异常调用 带有“2”个参数的“SetRight”:“无法获取用户 信息。” ---> System.Management.Automation.RuntimeException:无法从 服务可执行路径 VisualStudioRemoteDeployer.exe 。咨询 下面的日志:使用“2”参数调用“SetRight”的异常:“可能 未获取用户信息。” CategoryInfo :NotSpecified: (:) [], MethodInvocationException FullyQualifiedErrorId :异常
--- End of inner exception stack trace --- at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable输入) 在 System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(运行空间 rs,布尔型 performSyncInvoke) 在 System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(运行空间 rsToUse,布尔 isSync) 在 System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection
1 input, PSDataCollection1 输出,PSInvocationSettings 设置) 在 System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 输出,PSInvocationSettings 设置) 在 Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(字符串 [] 参数)
当我转到远程机器时,我成功地在 C:...\script.ps1 上执行了“Invoke-Expression”。
另外,我成功地从本地机器的 powerscript 控制台连接到远程机器。
任何建议表示赞赏。
【问题讨论】:
标签: powershell tfs