azure 读取文件的目录怎么_如何在Azure DevOps中的发布管道中读取工件的目录路径?...

在Azure DevOps的发布管道中,通过PowerShell任务显示工件目录路径时,$(System.DefaultWorkingDirectory)变量在发布管道中不存在。解决方案是使用$env:SYSTEM_DEFAULTWORKINGDIRECTORY来替代,因为变量名在转换为大写并用下划线替换"."后,可以在脚本中作为环境变量访问。例如,在Windows上,可以使用%AGENT_WORKFOLDER%或$env:AGENT_WORKFOLDER,在Linux和macOS上,使用$AGENT_WORKFOLDER。
摘要由CSDN通过智能技术生成

I want to be able to display a directory path of the Artifact in the PowerShell task in the Release pipeline.

In the build pipeline, the directory of the Artifact is described by the variable $(System.DefaultWorkingDirectory) and if I try to display it

in the PowerShell task using the command

Write-Host $(System.DefaultWorkingDirectory)

in the console output, it shows the path C:\agent\_work\3\a.

This variable doesn't exist in the Release pipeline and when I run the command

Get-ChildItem Env:

in the powerhsell task, in the release pipeline, I can see all environemnt variables but none of the variables stores the C:\agent\_work\3\a path

How can i get it, cuz somehow the AgentJob knows the proper directory of the Artifact when doing the Artifact downloading process.

Any ideas? Cheers

解决方案

When accessing bui

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值