Executing a VSTS/TFS build via PowerShell

This script queues a build in VSTS/TFS, based on the build definition ID or the build definition name and waits until the build completes.

Targets:

Visual Studio Team Services
Team Foundation Services

The script can be viewed on Gist: