Refactored updateHost.ps1, with tests, so it can be easily tested