One-click WP site generation wih wp-cli on Windows

This is the script I use on Windows under XAMPP. It includes a MySQL command to create the database, and a tweak to improve security by nuking user 1 (and all its content) straight after install, resulting in a clean empty database.

@echo off
set dbName="wp_yourdbname"
set dbPass="your_random_db_password"
set siteUrl="sitename.localdev.yourdomain.com"
set siteName="Kluwell"
set siteDesc=""
set adminUser="Second User Name"
set adminPass="admin_password"
set adminEmail="[email protected]"
:: these get nuked straight after install
set adminUserDummy="admin"
set adminUserDummyEmail="[email protected]"

SET /P AREYOUSURE=This will nuke the current site %siteUrl% and the DB %dbName%. Are you sure (Y/[N])?
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END

REM SQL setup
mysql -u root -p -e "DROP USER IF EXISTS %dbName%@localhost;DROP DATABASE IF EXISTS %dbName%;CREATE USER %dbName%@localhost IDENTIFIED BY '%dbPass%';CREATE DATABASE IF NOT EXISTS %dbName%; GRANT ALL PRIVILEGES ON %dbName% . * TO %dbName%@localhost;exit;"

REM setup core
call wp core download
call wp core config --dbname=%dbName% --dbuser=%dbName% --dbpass=%dbPass%
call wp core install --url=%siteUrl% --title=%siteName% --admin_user=%adminUserDummy% --admin_password=%adminPass% --admin_email=%adminUserDummyEmail%

REM remove first user
call wp user create %adminUser% %adminEmail% --role=administrator --user_pass=%adminPass%
call wp user delete 1 --yes 

Works a treat, especially if you set up a wildcard DNS entry to point *.localdev.yourdomain.com to 127.0.0.1 and configure mod_vhost_alias under Apache so that you can serve all the localdev sites out of a single directory, one subdir per host, so creating a subdirectory of dave equates to a url of dave.localhost.yourdomain.com