Splashtop Streamer Maxing out CPU

We run this on every machine, and it just takes care of the uninstallation and the force sync. One run and problem solved. Also, be sure to give it at least a 3-minute runtime for the slower machines.

Edit: Keep in mind, this fixes the issue if Syncro is providing the Splashtop. If you have BYO Splashtop, then replace the first part of the script with the one shared above by @ben2.

Import-Module $env:SyncroModule

# Uninstall Splashtop Streamer
$Program = "Splashtop Streamer"
$INSTALLED = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |  Select-Object DisplayName, UninstallString
$INSTALLED += Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, UninstallString
$SEARCH =$Program
$RESULT =$INSTALLED | ?{ $_.DisplayName -ne $null } | Where-Object {$_.DisplayName -match $SEARCH } 
Write-Host "We fould the following program match: $RESULT"

if ($RESULT.uninstallstring -like "msiexec*") {
$ARGS=(($RESULT.UninstallString -split ' ')[1] -replace '/I','/X ') + ' /q'
        Start-Process msiexec.exe -ArgumentList $ARGS -Wait
} else {
        Start-Process $RESULT.UninstallString /VERYSILENT -Wait
}

# Clear Streamer UUID
Set-Asset-Field -Name "Splashtop UUID" -Value ""

# Force Sync
$UpdateTime = (Get-Date).ToUniversalTime().AddMinutes(5).ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
#Update Syncro last_sync registry value
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\RepairTech\Syncro" -Name "last_sync" -Value "$UpdateTime"
 
function Run-InNewProcess{
  param([String] $code)
  $code = "function Run{ $code }; Run $args"
  $encoded = [Convert]::ToBase64String( [Text.Encoding]::Unicode.GetBytes($code))
 
  start-process -WindowStyle hidden PowerShell.exe -argumentlist '-windowstyle','hidden','-noExit','-encodedCommand',$encoded
}
 
$script = {
    $CurrentDateString = (Get-Date).ToString("yyyyMMdd")
    $LogLocation = "C:\ProgramData\Syncro\logs\$CurrentDateString-Syncro.Service.Runner.log"
    
    try {
        Import-Module $env:SyncroModule -erroraction stop 
    }
    catch {
        $env:RepairTechUUID = (Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\RepairTech\Syncro" -Name "uuid").uuid
        $env:RepairTechApiBaseURL = "syncromsp.com"
        $env:RepairTechApiSubDomain = (Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\RepairTech\Syncro" -Name "shop_subdomain").shop_subdomain
        $env:RepairTechFilePusherPath = "$($env:PROGRAMDATA)\Syncro\bin\FilePusher.exe"
 
        Import-Module "$($env:PROGRAMDATA)\Syncro\bin\module.psm1" 3>$null
    }
    
    Start-Sleep -s 10; 
    Restart-Service -Name "Syncro" -Force
    
    Log-Activity -Message "Restarted Syncro Service for Full Sync" -EventName "SyncroRestart"
 
    # Hack to get Get-Content -wait to work properly
    $hackJob = Start-Job {
      $f=Get-Item $LogLocation
      while (1) {
        $f.LastWriteTime = Get-Date
        Start-Sleep -Seconds 1
      }
    }
    
    # Job that confirms if the sync happened
    $job = Start-Job { param($LogLocation)
            try {
                Import-Module $env:SyncroModule -erroraction stop 
            }
            catch {
                $env:RepairTechUUID = (Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\RepairTech\Syncro" -Name "uuid").uuid
                $env:RepairTechApiBaseURL = "syncromsp.com"
                $env:RepairTechApiSubDomain = (Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\RepairTech\Syncro" -Name "shop_subdomain").shop_subdomain
                $env:RepairTechFilePusherPath = "$($env:PROGRAMDATA)\Syncro\bin\FilePusher.exe"
 
                Import-Module "$($env:PROGRAMDATA)\Syncro\bin\module.psm1" 3>$null
            }
        
        Get-Content $LogLocation -tail 0 -wait | where { $_ -match "Large sync complete" } |% { Log-Activity -Message "Full Sync Successful" -EventName "SyncroFullSync"; break }
    } -Arg $LogLocation
    
    # Wait for the Activity-Log job to complete or to timeout
    Wait-Job $job -Timeout 60
    
    # Cleanup jobs
    Get-Job | Stop-Job
    Get-Job | Remove-Job
}
 
Run-InNewProcess $script | Out-Null
 
Exit 0