The following is a sample code:
#Source: https://audministrator.wordpress.com/2014/07/01/powershell-accessing-ms-sql-compact-edition/
cls
$Host.UI.RawUI.BufferSize = New-Object Management.Automation.Host.Size (500, 25)
$binpath = "C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Desktop\";
[Reflection.Assembly]::LoadFile("$binpath\System.Data.SqlServerCe.dll") | out-null
#change GStav to you rfolder specific name
$connString = "Data Source=C:\Users\GStav\AppData\Roaming\Metalogix\Content Matrix Console - SharePoint Edition\JobHistory.sdf"
$cn = new-object "System.Data.SqlServerCe.SqlCeConnection" $connString
# create the command
$cmd = new-object "System.Data.SqlServerCe.SqlCeCommand"
$cmd.CommandType = [System.Data.CommandType]"Text"
$cmd.CommandText = "SELECT * FROM LogItems"
$cmd.Connection = $cn
#get the data
$dt = new-object "System.Data.DataTable"
$cn.Open()
$rdr = $cmd.ExecuteReader()
$dt.Load($rdr)
$cn.Close()
# $dt | Out-Default | Format-Table
$dt | Out-GridView -Title "JobHistory"