title: Saving an XML file in powershell requires complete path. Why?
body: <p>I am using the XML capabilities of powershell to modify a .config file.
  Calling <i>XMLDocument.Save</i> doesn't have any effect, unless I supply the complete path name.</p>
  
  <pre><code># Open the xml file
  $config = [xml](get-content web.config)
  #
  # modify the XML
  $config.SelectNodes("./configuration/connectionStrings/add[@name='LocalSqlServer']") | % { $connNode = $_ }
  $connNode.connectionString = $connNode.connectionString -replace '^(.*)Server=[^;]+(.*)$', '$1Server=192.168.5.2$2'
  #
  #
  # Now I save it again
  #
  # This doesn't save it!
  $config.Save("web.config");
  # However, this works
  $config.Save("{0}\\web.config" -f (get-location));
  </code></pre>
  
  <p>Why doesn't $config.Save("web.config") work?</p>
  
  <p>Did I end up saving it somewhere else, other than my local directory?</p>