In STSADM we had createsiteinnewdb. However, in PowerShell with SharePoint 2010 there is no equivalent command. Therefore, I put together a script that will prompt for server name, database name, site collection, owners and some other parameters to mimic this process. The script will create a new content database, create a new site collection in the database, then change the maxsize of the database to "1" to "lock" the database from storing additional site collections.

 

PowerShell
Edit|Remove
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue 
 
$server = Read-Host "Enter SQL Server" 
$dbname = Read-Host "Enter Database Name" 
$webapp = Read-Host "Enter Web Application URL" 
$site = Read-Host "Enter New Site Collection URL" 
$template = Read-Host "Enter Template ID" 
$owner1 = Read-Host "Enter Primary Site Collection Admin" 
$owner2 = Read-Host "Enter Secondary Site Collection Admin" 
 
New-SPContentDatabase -Name $dbname -DatabaseServer $server -WebApplication $webapp | out-null 
New-SPSite -URL $site -OwnerAlias $owner1 -SecondaryOwnerAlias $owner2 -ContentDatabase $dbname -Template $template | out-null 
Get-SPContentDatabase -Site $site | Set-SPContentDatabase -MaxSiteCount 1 -WarningSiteCount 0 
Write-Host "Site Collection at" $site "has been created in the" $dbname "content database" -ForegroundColor Yellow