VSTS 发布级别 "Windows PowerShell Cannot Run Script Whose Path Contains Spaces"

VSTS release level "Windows PowerShell Cannot Run Script Whose Path Contains Spaces"

我曾使用 VSTS 从事 DevOps。目前我使用“PowerShell”任务来 运行 PowerShell 脚本。但不幸的是,我的 VSTS 存储库名称具有 space(例如“WebApp Demo”),这就是我在 VSTS 发布级别执行 PowerShell 脚本时遇到问题的原因。

[error] Process completed with exit code 0 and had 1 error(s) written to the error stream.

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

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

将参数更改为:

-webConfigFilePath "$(ConfigFilePath)"