首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Azure管道提取任务7zip

Azure管道提取任务7zip
EN

Stack Overflow用户
提问于 2022-06-08 15:22:34
回答 1查看 395关注 0票数 1

在默认使用提取任务的情况下,无法将zip解压缩到目的地,its失败时出错:

代码语言:javascript
复制
##[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运行时,发行版将成功执行。

每当需要管理权限时,任务就会失败。

EN

回答 1

Stack Overflow用户

发布于 2022-06-10 06:28:40

从错误消息来看,7zip似乎没有安装在您的自托管代理上。在使用提取任务之前,尝试安装7zip。

以Bash任务为例:

代码语言:javascript
复制
brew install p7zip

对于Windows,使用下面的PowerShell脚本来安装:

代码语言:javascript
复制
$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 $installerPath
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72548321

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档