# Remove manually placed shortcuts (GPO replaces them)
foreach ($f in 'ALIS.url','Helpany.url','PharmCare.url','LinkRx.url') {
    Remove-Item "C:\Users\Public\Desktop\$f" -Force -ErrorAction SilentlyContinue
    Get-ChildItem "C:\Users" -Directory | Where-Object { $_.Name -notin 'Public','Default','Default User','All Users' } | ForEach-Object {
        Remove-Item (Join-Path $_.FullName "Desktop\$f") -Force -ErrorAction SilentlyContinue
    }
}
Write-Output "Cleaned all manual shortcuts"
gpupdate /force /wait:60 2>&1 | Out-Null
Write-Output "gpupdate done"
# Check result
Write-Output "=== Public Desktop ==="
Get-ChildItem "C:\Users\Public\Desktop\*" -ErrorAction SilentlyContinue | ForEach-Object { Write-Output "  $($_.Name)" }
Write-Output "=== pilot.test Desktop ==="
Get-ChildItem "C:\Users\pilot.test\Desktop\*" -ErrorAction SilentlyContinue | ForEach-Object { Write-Output "  $($_.Name)" }
