【发布时间】:2018-09-28 13:04:23
【问题描述】:
大家好,我不知道之前是否有人问过这个问题,但我需要使用 powershell 更新 xml 文件中的几个值我有以下代码它在本地工作但在 tfs 上它不起作用我收到以下错误@ 987654321@
我有以下代码
$EmployeeData= "C:\files\Employees.xml"
$oldEmployeeID= "23"
$NewEmployeeID= "25"
$content = [System.IO.File]::ReadAllText($EmployeeData).Replace($oldEmployeeID, $NewEmployeeID)
[System.IO.File]::WriteAllText($EmployeeData, $content)
localy 它可以工作,但在 tfs 上它的崩溃有人知道为什么 带有以下错误代码
System.Management.Automation.MethodInvocationException: Exception calling "ReadAllText" with "1" argument(s): "Value cannot be null.
【问题讨论】:
-
您能否详细说明“在 tfs 上它不起作用”?您是否将脚本包含在 TFS 构建中?您的构建定义如何?您使用的是哪个版本的 TFS?
标签: c# xml powershell tfs system.io.file