Try {
    # setup
    $rootDrive = (get-location).Drive.Name + ":"
    $pathDeployments = Join-Path -Path "$rootDrive" -ChildPath "Deployments"
    $pathVersion = "1.0.0.0"

    # service paths
    $pathSyncServiceExe = "$pathDeployments\Services\SyncService\$pathVersion\AAT.Genie.SyncService.exe"
    $pathStateMachineServiceExe = "$pathDeployments\Services\StateMachineService\$pathVersion\AAT.Genie.StateMachineService.exe"
    $pathControllerServiceExe = "$pathDeployments\Services\ControllerService\$pathVersion\AAT.Genie.ControllerService.exe"

    # install util
    $pathInstallUtil = "$rootDrive\WINDOWS\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe"

    Write-Host -ForegroundColor yellow "`n--- Services ---`n"

    Write-Host "Uninstalling Sync Service..." -NoNewline
    Invoke-Expression "$pathInstallUtil /uninstall $pathSyncServiceExe" | Out-Null
    Stop-Process -ProcessName AAT.Genie.SyncService* -Force
    Write-Host "done."

    Write-Host "Uninstalling State Machine Service..." -NoNewline
    Invoke-Expression "$pathInstallUtil /uninstall $pathStateMachineServiceExe" | Out-Null
    Stop-Process -ProcessName AAT.Genie.StateMachineService* -Force
    Write-Host "done."

    Write-Host "Uninstalling Controller Service..." -NoNewline
    Invoke-Expression "$pathInstallUtil /uninstall $pathControllerServiceExe" | Out-Null
    Stop-Process -ProcessName AAT.Genie.ControllerService* -Force
    Write-Host "done."
}
Catch {
    throw $_.Exception.Message
}