我正在使用yuicompressor來縮小和混淆一些javscript文件。我試圖動態構建文件路徑並將它從powershell傳遞給minifier。將參數傳遞給powershell中的程序時遇到問題
這裏是什麼工作:
$results = java -jar c:\yui\yuicompressor-2.4.2.jar c:\MyFile.js -v --charset utf-8
這裏是行不通:
$yuiPath = "c:\yui\yuicompressor-2.4.2.jar"
$filePath = "c:\MyFile.js"
$results = java -jar $yuiPath $filePath -v --charset utf-8
它顯然不順心的$filePath -v --charset utf-8
一部分,因爲我順利拿到的YUICompressor幫助文本當我運行它。有什麼建議麼?