【问题标题】:Using Transifex with PowerShell将 Transifex 与 PowerShell 一起使用
【发布时间】:2012-05-02 06:21:12
【问题描述】:

我正在尝试制作一个 powershell 脚本来为我的项目设置 Transifex,但当我尝试运行时,我不断收到相同的错误:

& tx "set --source -r myproject.auth-resx_myproject -l ""en"" ""C:\MyProjectDir\ResourceFile.resx"""

错误是:

    tx.exe : tx: Command set --source -r myproject.auth-resx_myproject -l en C:\MyProjectDir\ResourceFile.resx not found
    At line:1 char:2
    + & <<<<  tx "set --source -r myproject.auth-resx_myproject -l ""en"" ""C:\MyProjectDir\ResourceFile.resx""" 
    + CategoryInfo          : NotSpecified: (tx: Command set....resx not found:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

看起来有些字符没有正确转义,因为在没有执行运算符和引号的情况下运行脚本。

tx set --source -r myproject.auth-resx_myproject -l "en" "C:\MyProjectDir\ResourceFile.resx"

我做错了什么?

【问题讨论】:

    标签: powershell resources translation quotes


    【解决方案1】:

    这引出了一个问题,为什么您首先尝试使用&amp;。但无论如何,你的问题是你的论点列表。你不需要引用它。实际上,除非您想将它作为单个参数传递给命令,否则您不能引用它。鉴于您显示的线路有效,您显然没有这样做。

    顺便说一句,在这种情况下,工作行也不需要引号。

    【讨论】:

    • 谢谢!问题确实是运算符'&'。我现在使用 'iex' 来执行我的脚本,它就像一个魅力!
    • 你读过我写的东西吗?不过,Invoke-Expression 从来都不是这个问题的答案。
    猜你喜欢
    • 2018-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多