1
我一直在阅读Xpath查询(我认为在dotnet中使用的版本2,并且仍然无法让我的脚本能够设置一个XML的区域。我怎样才能做到这一点在PowerShell中? 谢谢!如何使用Powershell解析VS2013 csproj XML文件以修改PreBuildEvent
function Get-XmlCsproj { $toolsPath = "C:\" [xml] $axml= Get-Content -Path "$toolsPath\csproj03.csproj" # this outputs the right string ; "SOMETHING", but can't set it equal to a thing $axml.Project.PropertyGroup.PreBuildEvent # nil from ; $axml.SelectSingleNode("/Project/PropertyGroup/PreBuildEvent") }
我会去试试,ty! – AnneTheAgile