![](/img/trans.png)
[英]How can I get a variable valued current working directory (pwd) in powershell profile
[英]How can I print the current working directory in a Jenkinsfile using powereshell
我試過這個
powershell( returnStdout: true, script: 'Get-Location' )
但我在日志中得到的只是一個空白行,值得說明諸如Write-Output
類的命令工作。
Since this syntax returns the output stream, ie stream 1 of Powershell output without printing it to the console, you need to store the stdout in a variable and print it explicitly in the Jenkinsfile.
currentDir = powershell(returnStdout: true, script: 'Get-Location')
println(currentDir)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.