我正在尝试使用 Pipeline 中的 PowerShell 任务在 DevOps 代理服务器中创建 RamDisk。该脚本可以创建 Ramdisk 驱动器,但无法对其进行格式化和挂载。它给出的错误是它需要提升提示。
如何在 Azure DevOps 管道中以管理员权限运行 PowerShell 任务
最佳答案
既然你加了 azure-devops-self-hosted-agent
标记,我假设您正在使用自托管构建代理进行构建。然后您可以尝试更新构建代理以使用管理员帐户运行。
If you configured the agent to run as a service, it starts automatically. You can view and control the agent running status from the services snap-in. Run
services.msc
and look for the agent. If you need to change the agent's logon account, don't do it from the Services snap-in. Instead, try to re-configure the agent and run it with an administrator account.
关于powershell - 如何在 Azure Devops 管道中以管理员权限运行 PowerShell 任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64669465/