Two things...
First.. you dont want to use select.. use foreach-object
$log | foreach-object{$_.Message -replace "'", ""} | export-clixml
Second.. you can try WMI object to see if parses in XML better
PS> Get-WmiObject Win32_NTLogEventLog
"Glenn W." <Glenn W.@xxxxxx> wrote in message
news:BEE4D31B-A4A2-4214-B70A-096F589BAEBC@xxxxxx
> Hello,
>
> I am trying to export the event log to a sql database and in doing so, I
> exporting the eventLog as an XML string and passing it into a stored
> procedure which will parse.
>
> My trouble is that the messages contain apostrophes which of course SQL
> doesn't like and I was curious as to how I would go about escaping them in
> line as I export the data.
>
> Something like:
> $log = get-eventlog -list
> $log = $log[0].Entries
>
> $log | select message -replace "'", "" | export-clixml
>
> Of course, unfortunately that doesn't work. Does anyone have any
> suggestions? Thanks in advance.


You will only get the message