title: Change VMConfig file using azure powershell
body: <p>I have a vmConfig file. I want to change subnet and IP Address as I want to create a new VM out of config file in new subnet, rest all configurations no need to be changed. I can manually edit xml file content but I want to do it through powershell so that I can have an automated process for everything.</p>
  
  <p>Here is the sample vmConfig xml-</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;PersistentVM xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;ConfigurationSets&gt;
      &lt;ConfigurationSet xsi:type="NetworkConfigurationSet"&gt;
        &lt;ConfigurationSetType&gt;NetworkConfiguration&lt;/ConfigurationSetType&gt;
        &lt;InputEndpoints&gt;
          &lt;InputEndpoint&gt;
            &lt;LocalPort&gt;5986&lt;/LocalPort&gt;
            &lt;Name&gt;PowerShell&lt;/Name&gt;
            &lt;Port&gt;64929&lt;/Port&gt;
            &lt;Protocol&gt;tcp&lt;/Protocol&gt;
            &lt;Vip&gt;191.237.20.225&lt;/Vip&gt;
            &lt;EnableDirectServerReturn&gt;false&lt;/EnableDirectServerReturn&gt;
            &lt;IdleTimeoutInMinutes xsi:nil="true" /&gt;
          &lt;/InputEndpoint&gt;
        &lt;/InputEndpoints&gt;
        &lt;SubnetNames&gt;
          &lt;string&gt;mysubnet&lt;/string&gt;
        &lt;/SubnetNames&gt;
        &lt;StaticVirtualNetworkIPAddress&gt;12.13.14.15&lt;/StaticVirtualNetworkIPAddress&gt;
        &lt;PublicIPs /&gt;
        &lt;NetworkInterfaces /&gt;
  </code></pre>
  
  <p>I am interested changing only IP Address and Subnet.</p>