Why do I get the value System.Xml.XmlDocument? RRS feed

  • Question

  • Hello everyone,

    I facing the problem that when I run these lines:

    $NIC = Get-NetAdapter
    Get-NetAdapter -Name $NIC.Name | Rename-NetAdapter -NewName "$TestXML.Test.Ethernet.AdapterName"
    <?xml version = "1.0" encoding = "utf-8" ?>
        <Ethernet AdapterName = "LAN" />

    my LAN adapter is assigned the name "[string]System.Xml.XmlDocument.TestXML.Test.Ethernet.AdapterName" although the XML file contains the value "LAN".
    Can someone explain to me why this is the case and how to solve the problem?


    Thursday, July 2, 2020 6:17 AM

All replies

  • Remove the quotes.


    • Proposed as answer by Vector BCO Thursday, July 2, 2020 5:36 PM
    Thursday, July 2, 2020 6:40 AM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,

    Yang Yang

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, July 3, 2020 3:01 AM