qutter.ps1 946 B

12345678910111213141516171819202122232425262728293031323334
  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. $A = 1
  17. Write-Host "Password meets the security standards."
  18. AI_SetMsiProperty PASS_STRONG "true"
  19. } else {
  20. Write-Host "Password does not meet the security standards. Make sure your password is:"
  21. AI_SetMsiProperty PASS_STRONG "false"
  22. [System.Windows.Forms.MessageBox]::Show("密码错误!")
  23. }
  24. }
  25. $Password = AI_GetMsiProperty USER_PASSWORD
  26. Check-PasswordComplexity -Password $Password