【问题标题】:gitlab ci yml error on passing file path to powershell将文件路径传递给powershell时出现gitlab ci yml错误
【发布时间】:2019-09-24 07:49:32
【问题描述】:

试图通过 gitlab ci yml 中的 powershell 调用 mstest.exe。 当我将路径指定为C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\mstest.exe powershell 时,会出现错误提示C:\program no such cmdlet function exists

当我在引号中给出路径时,我得到一个无效的 yml 错误:

This GitLab CI configuration is invalid: (<unknown>): found unknown escape character while parsing a quoted scalar at line 26 column 17
test_job:
  stage: test
  variables:
    MSTestPath: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\mstest.exe"
    TestContainer: "/testcontainer: +$ProjectDLL"
    TestName: "/test:+$TestName"
    TestSettings: "/testsettings: +$TestSettingsPath"
  script:
    - echo "testing..."
    - powershell '&' $MSTestPatch  $TestContainer $TestName $TestSettings
  only:
    - master
  tags:
    - migration

我想在我的运行器(这是我的 Windows 机器)中使用 gitlab CI 执行我的 mstest,使用 powershell 作为 shell。

【问题讨论】:

    标签: c# powershell yaml mstest gitlab-ci


    【解决方案1】:

    您可以使用\"C:\Program Files (x86)\Microsoft Visual Studio 14.0\"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-15
      • 2022-01-19
      • 2019-10-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多