qutter.ps1 930 B

123456789101112131415161718192021222324252627282930313233
  1. #Requires -version 3
  2. Param(
  3. [string]$Password = $null
  4. )
  5. # When testing or debugging your script, you can quickly display a message box
  6. [System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
  7. # Function to check password complexity
  8. Function Check-PasswordComplexity {
  9. param (
  10. [string]$Password
  11. )
  12. $BuiltInPassword = "123456!"
  13. AI_SetMsiProperty PASS_STRONG ""
  14. # Check if all requirements are met
  15. if ($Password -eq $BuiltInPassword) {
  16. Write-Host "Password meets the security standards."
  17. AI_SetMsiProperty PASS_STRONG "true"
  18. } else {
  19. Write-Host "Password does not meet the security standards. Make sure your password is:"
  20. AI_SetMsiProperty PASS_STRONG "false"
  21. [System.Windows.Forms.MessageBox]::Show("密码错误!")
  22. }
  23. }
  24. $Password = AI_GetMsiProperty USER_PASSWORD
  25. Check-PasswordComplexity -Password $Password