在默认使用提取任务的情况下,无法将zip解压缩到目的地,its失败时出错:
##[error]Unable to locate executable file: 'C:\azagent\A5\_work\_tasks\ExtractFiles_5e1e3830-fbfb-11e5-aab1-090c92bc4988\1.200.0\7zip\7z.exe'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.说明它未能找到默认的7zip路径。尝试使用自定义路径设置,但也失败与相同的错误。
更新
问题似乎是由代理的权限引起的。仍然无法在服务模式下以管理权限执行发布。当以交互模式作为Admin运行时,发行版将成功执行。
每当需要管理权限时,任务就会失败。
发布于 2022-06-10 06:28:40
从错误消息来看,7zip似乎没有安装在您的自托管代理上。在使用提取任务之前,尝试安装7zip。
以Bash任务为例:
brew install p7zip对于Windows,使用下面的PowerShell脚本来安装:
$dlurl = 'https://7-zip.org/' + (Invoke-WebRequest -UseBasicParsing -Uri 'https://7-zip.org/' | Select-Object -ExpandProperty Links | Where-Object {($_.outerHTML -match 'Download')-and ($_.href -like "a/*") -and ($_.href -like "*-x64.exe")} | Select-Object -First 1 | Select-Object -ExpandProperty href)
# modified to work without IE
# above code from: https://perplexity.nl/windows-powershell/installing-or-updating-7-zip-using-powershell/
$installerPath = Join-Path $env:TEMP (Split-Path $dlurl -Leaf)
Invoke-WebRequest $dlurl -OutFile $installerPath
Start-Process -FilePath $installerPath -Args "/S" -Verb RunAs -Wait
Remove-Item $installerPathhttps://stackoverflow.com/questions/72548321
复制相似问题