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

时间:2019-11-14 10:19:18

标签: powershell jenkins

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用于类:

任何帮助将不胜感激。

0 个答案:

没有答案