I have a powershell script that spool the result of an Stored Procedure in SQL Server into a DataTable. This DT has only one row that is an XML string:
#-----------------------
#-- XML file Creation --
#-----------------------
[String]$Step = "XML file Creation."
&{
foreach ($row in $dt_table1.Rows){
$row[0].ToString().Trim()
} }| set-content $DestinationXMLFilePath
However, the output file generated by this creates a TXT file not in an XML format, if the line is too long it automatically put a new line to continue and this is not correct.
Is there a way to generate an XML in XML format?