# 编译密码重置工具 Write-Host "开始编译 reset-password.exe..." -ForegroundColor Cyan # 设置工作目录 Set-Location $PSScriptRoot # 编译 go build -o reset-password.exe cmd/reset-password/main.go # 检查编译结果 if ($?) { Write-Host "`n✅ 编译成功!" -ForegroundColor Green Write-Host "文件位置:$PSScriptRoot\reset-password.exe" -ForegroundColor Yellow Write-Host "`n使用方法:" -ForegroundColor Cyan Write-Host " .\reset-password.exe # 自动生成随机密码" -ForegroundColor White Write-Host " .\reset-password.exe -p `"你的新密码`"" # 使用指定密码" -ForegroundColor White } else { Write-Host "`n❌ 编译失败!" -ForegroundColor Red Write-Host "请检查错误信息 above" -ForegroundColor Yellow }