Split Text File using Powershell (Single Line)

A few days ago a friend asked why working with text files in powershell was so annoying. I asked him what the problem was, and he was trying to split a text file in half.

I gave him this simple line:

$content = (Get-Content C:\input-file.txt -Raw); $content.Substring(0,$content.Length * 0.5) | Set-Content "C:\first-half.txt"

This will get the raw text content of a file (C:\input-file.txt), and dump out the first 50% of the file to C:\first-half.txt

Data Generation Plans with Windows Azure SQL

Visual Studio cannot create Data Generation Plans for Windows Azure because the schemas aren’t compatible.

These are the steps you need to take if you want to generate data for an Azure database.

  1. Import your Azure database to your local SQL / SQL Express instance on your development machine
  2. Create the data generation plan using the local database
    data generation complete
  3. Use the SQL Database Migration Wizard to create your migration backups
    SQL Migration Wizard - Script Wizard
  4. Continue with the SQL Database Migration Wizard to publish to a database in Azure
    Target Server Response

Useful links