title: Powershell: [xml].SelectNodes doesn't return expected results?
body: <p>I'm using powershell to parse a C# project file, which is a standard xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"&gt;
      &lt;PropertyGroup&gt;
          &lt;ProjectType&gt;Local&lt;/ProjectType&gt;
      &lt;/PropertyGroup&gt;
      &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "&gt;
          &lt;CodeAnalysisRules&gt;-Microsoft.Design#CA2210;Microsoft&lt;/CodeAnalysisRules&gt;
          &lt;PlatformTarget&gt;AnyCPU&lt;/PlatformTarget&gt;
      &lt;/PropertyGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>I wish to select out "CodeAnalysisRules" tag content using "SelectNodes" function:</p>
  
  <pre><code>function f($fileName)
  {
      Write-Host "Parsing $fileName"
      [xml]$xml=Get-Content $fileName
      if([String]::IsNullOrEmpty($xml.Project.NamespaceURI))
      {
          write-Host "skip!" -ForegroundColor Yellow
      }
      else
      {
          [System.Xml.XmlNamespaceManager]$ns = $xml.NameTable
          $ns.AddNamespace("Any", $xml.DocumentElement.NamespaceURI)
          $ns
          $nodes = $xml.SelectNodes("//CodeAnalysisRules",$ns)
          $nodes.Count
      }
  }
  f d:\m.xml
  </code></pre>
  
  <p>I expected to get the string inside  but in fact I got:</p>
  
  <pre><code>Parsing d:\m.xml
  
  xmlns
  xml
  Any
  0
  </code></pre>
  
  <p>Anything wrong with my program or assumption?
  Thanks!</p>