2016-11-18 16 views
0

PowerShell v3では、テンプレートにパラメータargsを付けてTextTransform.exeを実行します。ここに私の変数と私が試したオプションがあります。これは '-a'パラメータなしで動作することに注意してください。しかし、テンプレートを正しく実行するにはargsが必要です。Powershellのargsを使用して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構文であることが確認されます。

答えて

0

それが失敗したことはありません... 1件の最後の検索は、後にほとんどあきらめて、答えが見つかりました:コンボを

Using $(SolutionDir) when running template via TextTransform.exe

を私は明らかに以前ましたしようとしなかった。

& "$textTransformPath" "$templatePath" -a !!TheParam!$TheValue 

・ホープこれは他の人に役立ちます。

関連する問題