【发布时间】:2021-01-28 03:06:54
【问题描述】:
我有一个在交互模式下运行 Azure Devops 代理的 Windows 10 Enterprise VM。代理使用机器拥有的唯一用户运行,并且它是禁用 UAC 的管理员。但是,当执行需要提升的命令提示符的任务时,如注册 dll,命令会失败并显示以下错误消息:
##[error]Cmd.exe exited with code '5'.
当我尝试将文件复制到 Windows\SysWow64 时,会出现此消息
##[error]Error: Failed cp: cp: copyFileSync: could not write to dest file (code=EPERM):C:\windows\SysWow64\test.txt
我的睾丸也因以下错误消息而失败:
Test method TestesRegressaoPGB.Autenticacao.AutenticarNoPGBL02 threw exception:
System.AggregateException: One or more errors occurred. (The requested operation requires elevation.) ---> System.ComponentModel.Win32Exception: The requested operation requires elevation.
TestCleanup method TestesRegressaoPGB.Autenticacao.Cleanup threw exception. System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object..
如何在提升时运行所有命令?
【问题讨论】:
标签: azure-devops windows-10 azure-pipelines azure-devops-self-hosted-agent