0
我想在PowerShell v3中使用模板上的参数args运行TextTransform.exe。这里是我的变数和我尝试的选项。请注意,它没有'-a'参数,但我需要参数才能正确运行模板。使用Powershell中的参数运行TextTransform.exe
$textTransformPath = "C:\Program Files (x86)\Common Files\Microsoft Shared\TextTemplating\14.0\TextTransform.exe"
$templateath = "$ProjectPath\TheTemplate.tt"
$textTransformParams = "-a !!TheParam!$TheValue"
#& "$textTransformPath" "$templatePath" <-- this runs, but no args!
# these don't work:
& "$textTransformPath" "$templatePath" $textTransformParams
& "$textTransformPath" "$templatePath" "$textTransformParams"
我不知道为什么这是如此困难,它似乎应该很容易。如果我在标准命令行中输入它,它会起作用,这证明问题出在我的PS语法上。