<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
</Project>
К примеру нужно вытащить "bin\Release" из релизной конфигурации:
[xml]$proj = (Get-Content $projectFileName)
$nsmgr = New-Object System.Xml.XmlNamespaceManager $proj.NameTable
$nsmgr.AddNamespace('a','http://schemas.microsoft.com/developer/msbuild/2003')
$assemblyName = $proj.SelectSingleNode('//a:AssemblyName', $nsmgr)
$node = $proj.SelectNodes("//a:PropertyGroup[@Condition]", $nsmgr)
$outputPath = $node| ? Condition -Like '*Release*' | select OutputPath
Можно ли как нибудь вытащить эту строку, только с помощью SelectNodes, что-то типо такого:
SelectNodes("//a:PropertyGroup[@Condition -Like '*Release*']", $nsmgr)