RyanWilcox had posted a script at here, that can use the following command to add subrepository automatically:
$ cd $TOP_OF_HG_PROJECT
$ addsubrepo.sh $URL_TO_HG_PROJECT relative_path/you/want_to/put_the_subrepo
How to translate it into Windows batch or powershell script?
Here is a quick and dirty translation. Haven’t tested as I got no Mercury around. The initial script seems to be easy enough to translate into Powershell.