【问题标题】:VSTS release level "Windows PowerShell Cannot Run Script Whose Path Contains Spaces"VSTS 版本级别“Windows PowerShell 无法运行路径包含空格的脚本”
【发布时间】:2018-07-20 03:01:45
【问题描述】:

我使用 VSTS 从事 DevOps 方面的工作。目前我使用“PowerShell”任务来运行 PowerShell 脚本。但不幸的是,我的 VSTS 存储库名称中有空格(例如“WebApp Demo”),这就是我在 VSTS 版本级别执行 PowerShell 脚本时遇到问题的原因。

[error] 进程以退出代码 0 完成并写入了 1 个错误 到错误流。

VSTS 版本定义中的 PowerShell 任务配置

为了解决上述错误,我关注了很多博客,但问题都是一样的。

  1. Windows Powershell doesn't seem to accept target paths with spaces
  2. Run a PowerShell Script with Space in the Path
  3. Windows PowerShell Cannot Run Script Whose Path Contains Spaces

【问题讨论】:

  • 这是一个很长的镜头,但您是否尝试将脚本路径封装在双引号中?
  • 应该可以了,添加 System.debug 变量并将值设置为 true,然后开始发布并在 OneDrive 上共享此日志。
  • @Persistent13,我已经用双引号试过了,但它不能正常工作。

标签: powershell spaces azure-pipelines-release-pipeline


【解决方案1】:

根据日志,您 ConfigFilePath 的值是包含空格的路径。

将参数更改为:

-webConfigFilePath "$(ConfigFilePath)"

【讨论】:

    猜你喜欢
    • 2018-08-01
    • 2021-11-22
    • 2019-01-22
    • 1970-01-01
    • 1970-01-01
    • 2021-08-25
    • 2018-01-27
    • 1970-01-01
    • 2016-07-11
    相关资源
    最近更新 更多