Powershell: Convert XML to String

前端 未结 3 1346
[愿得一人]
[愿得一人] 2021-01-01 09:33

I am searching for a way to convert a XML-Object to string.

Is there a way like $xml.toString() in Powershell?

3条回答
  •  [愿得一人]
    2021-01-01 09:39

    How are you creating the XML object?

    Typically, if you want an XML string from an object, you'd use:

    $object | ConvertTo-Xml -As String
    

提交回复
热议问题