Here is a great post by one of my colleagues on how to create a self-signed certificate using PowerShell: http://blogs.technet.com/vishalagarwal/archive/2009/08/22/generating-a-certificate-self-signed-using-powershell-and-certenroll-interfaces.aspx.