#Requires -version 3 Param( [string]$Password = $null ) # When testing or debugging your script, you can quickly display a message box [System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') # Function to check password complexity Function Check-PasswordComplexity { param ( [string]$Password ) $BuiltInPassword = "123456!" AI_SetMsiProperty PASS_STRONG "" # Check if all requirements are met if ($Password -eq $BuiltInPassword) { $A = 1 Write-Host "Password meets the security standards." AI_SetMsiProperty PASS_STRONG "true" } else { Write-Host "Password does not meet the security standards. Make sure your password is:" AI_SetMsiProperty PASS_STRONG "false" [System.Windows.Forms.MessageBox]::Show("密码错误!") } } $Password = AI_GetMsiProperty USER_PASSWORD Check-PasswordComplexity -Password $Password