- <button class="command-copy" onclick="copyToClipboard('# Stop running processes\nGet-Process | Where-Object { $_.ProcessName -eq \'pai\' -or $_.ProcessName -eq \'persistenceai\' } | Stop-Process -Force -ErrorAction SilentlyContinue\nStart-Sleep -Seconds 2\n# Find all pai/persistenceai installations\n$installDirs = @()\n$paiCmd = Get-Command -Name \'pai\' -ErrorAction SilentlyContinue\n$persistenceaiCmd = Get-Command -Name \'persistenceai\' -ErrorAction SilentlyContinue\nif ($paiCmd) { $installDirs += Split-Path $paiCmd.Source -Parent }\nif ($persistenceaiCmd) { $installDirs += Split-Path $persistenceaiCmd.Source -Parent }\n$installDirs = $installDirs | Select-Object -Unique\n# Remove found installation directories\nforeach ($dir in $installDirs) { if (Test-Path $dir) { Remove-Item -Path $dir -Recurse -Force -ErrorAction SilentlyContinue; Write-Host \'Removed: $dir\' } }\n# Remove standard directories\n$dirs = @(\'$env:USERPROFILE\\.persistenceai\', \'$env:USERPROFILE\\.pai\', \'$env:USERPROFILE\\.config\\persistenceai\', \'$env:USERPROFILE\\.config\\pai\', \'$env:LOCALAPPDATA\\persistenceai\', \'$env:LOCALAPPDATA\\pai\')\nforeach ($dir in $dirs) { if (Test-Path $dir) { Remove-Item -Path $dir -Recurse -Force -ErrorAction SilentlyContinue } }\n# Remove from PATH (User and System)\n$userPath = [Environment]::GetEnvironmentVariable(\'Path\', \'User\')\nif ($userPath) {\n $newUserPath = ($userPath -split \';\' | Where-Object { $_ -and $_ -notmatch \'\\.persistenceai\' -and $_ -notmatch \'\\.pai\' }) -join \';\'\n [Environment]::SetEnvironmentVariable(\'Path\', $newUserPath, \'User\')\n}\n# Update current session PATH\n$env:Path = ($env:Path -split \';\' | Where-Object { $_ -and $_ -notmatch \'\\.persistenceai\' -and $_ -notmatch \'\\.pai\' }) -join \';\'\nWrite-Host \'PersistenceAI completely uninstalled. Please restart PowerShell for changes to take effect.\' -ForegroundColor Green', this, 'windows')">Copy</button>
0 commit comments