powershell - 来自 PowerShell Azure WebJob 的 "Window title cannot be longer than 1023 characters"

标签 powershell azure azure-webjobs

我有以下代码(从较大的脚本中提取):

Write-Output "Syncing $directory"
Push-Location $directory
git pull origin $branch
$directoryName = [IO.Path]::GetFileName($directory)    
git log -n 1 --pretty=format:"%H %cd %aN%n%B" --date=short > "..\$directoryName.lastcommit.txt"
Pop-Location

在 Windows Azure WebJob 中运行时偶尔(约 50% 的机会)会产生错误:

[05/06/2014 22:20:43 > e5e3ee: INFO] Syncing D:\home\site\!roslyn-sources\DeclarationExpressions
[05/06/2014 22:20:45 > e5e3ee: ERR ] From https://git01.codeplex.com/roslyn
[05/06/2014 22:20:45 > e5e3ee: ERR ]  * branch            DeclarationExpressions -> FETCH_HEAD
[05/06/2014 22:20:45 > e5e3ee: INFO] Already up-to-date.
[05/06/2014 22:20:45 > e5e3ee: INFO] [ERROR] Window title cannot be longer than 1023 characters.
[05/06/2014 22:20:45 > e5e3ee: INFO] Returning exit code 1
[05/06/2014 22:20:45 > e5e3ee: SYS INFO] Status changed to Failed
[05/06/2014 22:20:45 > e5e3ee: SYS ERR ] Job failed due to exit code 1

我在本地运行时从未遇到此错误。

可能是什么原因?

最佳答案

也许您正在运行的 exe 的窗口标题发生了变化。 因此,不要在 powershell 脚本中直接调用 git,而是使用 cmdlet Start-Process

运行它

关于powershell - 来自 PowerShell Azure WebJob 的 "Window title cannot be longer than 1023 characters",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23505677/

相关文章:

azure - 并行运行 Web 作业

c# - Azure webjob 参数

arrays - 如何先按字母然后按数字组合对字符串数组进行排序?

azure - 如何更改 Ubuntu 12.4 上的*默认*打开文件限制

windows - 在窗口调整大小时调整 Powershell 屏幕缓冲区的大小

python - 在 adls 中上传大文件时出现超时错误

azure - 如何在 Windows Azure 网站上提供 .exe 文件下载?

azure - Linux 上的 Azure CLI 上传 Web 作业失败(进程内存不足)

powershell - ValidateSet 带空格的值

powershell - 检查文件夹是否被授予访问权限