PowerShell and SQL Server Compact 4.0: A Happy Mix

Using SQL Server Compact 4.0 from PowerShell is easy and powerful. Here is an example that shows how to reference the needed libraries, create the database, and add a table to the database – all from PowerShell. 1: $binpath = "C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Desktop\"; 2: [Reflection.Assembly]::LoadFile("$binpath\System.Data.SqlServerCe.dll") 3: $connectionString = "Data Source=’C:\temp\testDB.sdf’;" 4: 5:…

1

Use PowerShell To Test Code Snippets

If you are like me, then you might have multiple Console applications in your projects folder that you use for testing small chunks of code.  I think at one point recently, I was up to ConsoleApplication28 before I cleaned up the unused projects.  These are typically used for testing small snippets of code that I…

1

Replacing CMD with PowerShell

First off, I really like Windows PowerShell.  I have been using it for a while now and I find it extremely powerful.  I now use it for every command line thing that I do.  (I would also recommend the PowerShell Community Extensions.  These add some very useful features to PS.  One that I particularly enjoy…

7