Set $PSScriptRoot if not already set

This makes the build compatible with Powershell V2 whilst retaining the
ability to run from arbitrary directories.