# 获取所有用户的 PATH 环境变量
$currentPath = [System.Environment]::GetEnvironmentVariable("Path", "Machine")
if (-not $currentPath.EndsWith(";")) {
$newPath = $currentPath +";"
}
# 检查 C:\ProgramData\Anaconda3 是否已存在
if (-not $currentPath.Contains("C:\ProgramData\Anaconda3")) {
# 添加 C:\ProgramData\Anaconda3
$newPath = $currentPath + "C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Scripts;C:\ProgramData\Anaconda3\Library\mingw-w64\bin;C:\ProgramData\Anaconda3\Library\usr\bin;C:\ProgramData\Anaconda3\Library\bin"
[System.Environment]::SetEnvironmentVariable("Path", $newPath, "Machine")
Add-Type -AssemblyName PresentationFramework
[System.Windows.MessageBox]::Show("请重启电脑!", "提示", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Information)
}