Notice, that we cast loaded text to [xml] type. Actually $configXml is System.Xml.XmlDocument instance.
If file contains corrupted xml or no xml at all you will get exception.
This cast is very interesting fact, at first I thought that PS searches for constructor of given type which accepts argument of left expression. But XmlDocument has neither constructor nor static method (something like Load(string)) which accepts string. PowerShell magic. This process is called Attribute Transformation. It allows to perform hidden transformation of types in freestyle way (like instantiate XmlDocument and invoke its method LoadXml(string) instead of type cast). You can start your own investigation from here: http://goo.gl/iZEGA.
Navigate XML
Another PS magic issue. As you can notice, we can use our xml variable like dynamic to access its attributes or nodes.
If this 'dynamic path' points to several elements (like configuration.appSettings.add in our case) we will get array of nodes.
Navigate via XPath
You can use XPath to select nodes and attributes with Select-Xml cmdlet. It does not return elements itself but SelectXmlInfo instances. Use their Node property to get node itself:
To edit XML you need to navigate to any element via one of approaches described and change its InnerXML or InnetText properties (in case of attribute you need to change Value property):
Use $configXml.Save($filePath) to save human readable XML, because other approaches (like Set-Content -Path $someFile -Value $configXml.InnerXml) will loose tabulation and formatting and save all XML in one line: