Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

$runKeyPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run"
$existing = Get-ItemProperty -Path $runKeyPath -Name "ImageAnywhereAgent" -ErrorAction SilentlyContinue
if ($existing) {
    Remove-ItemProperty -Path $runKeyPath -Name "ImageAnywhereAgent"
    Write-Host "Removed ImageAnywhereAgent logon startup for this user."
}
else {
    Write-Host "No ImageAnywhereAgent logon startup entry was present for this user."
}
