I have a sql query with for xml explicit clause. Result i need to store in an xml file. I am using a powershell command to do so : invoke-sqlcmd -inputFile $inputFilePath | Out-File -filePath $outputFilePath
this gives me an output file similar to
XML_F52E2B61-18A1-11d1B1000805F49916B
'<'person>dsugfiugds'<'/person>...
'<'student>sdgfdg<\student>'<'id>45<\id>'<'cla...
ss>sdfsdfsfd<....
This file has also been truncated , you can see the ... appears Where as i need the xml to be in the correct format i.e an xml file itself.
Instead of Out-File have you tried Export-Clixml?