尝试在Jenkins共享库管道中运行Powershell代码时,获取“ No such property:”

def workSpace = WORKSPACE
def outPath = workSpace+"\\installation\\FragmentOutput.wxs"

powershell """
    Set-Location ${workspace}
    $wixTool = Get-ChildItem C:\\tools\\ | where { $_.PSIsContainer -and $_.Name -like "WiX.Toolset.UnofficialFork*" } | Sort CreationTime -Descending | Select -First 1 | Select FullName
    Write-Output $wixTool
    $wixPath = $wixTool.FullName
    Write-Output $wixPath
    $wixPath\\tools\\wix\\heat dir ${workSpace}\\deploy -nologo -ag -cg fragmentComponentRefGroup -dr INSTALLLOCATION -gg -sfrag -sreg -suid -scom -srd -sw1076 -var var.SourceFilesDir -out ${outPath}
"""
上面的

是groovy文件中的powershell代码。詹金斯在执行上述代码时抛出了以下错误。 groovy.lang.MissingPropertyException:无此类属性:wixTool用于类:

任何帮助将不胜感激。

worinima1 回答:尝试在Jenkins共享库管道中运行Powershell代码时,获取“ No such property:”

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3103531.html

大家都在问