Curated Examples
Normalize password-quality output
Use PasswordSolution replacements to make password-quality output easier to read.
This pattern is useful when report fields contain compact codes that need display-friendly values.
It is adapted from Examples/Example-FindUsersPasswordQualityConsoleWithReplacements.ps1.
Example
Import-Module PasswordSolution
$replacements = @(
New-PasswordConfigurationReplacement -PropertyName 'Country' -Type eq -PropertyReplacementHash @{
'PL' = 'Poland'
'DE' = 'Germany'
'US' = 'United States'
'Unknown' = 'Not specified'
} -OverwritePropertyName 'CountryName'
)
$users = Find-PasswordQuality -Replacements $replacements
$users | Select-Object Name, SamAccountName, CountryName | Format-Table -AutoSize
What this demonstrates
- defining value replacements
- writing normalized values to a new property
- keeping report output readable for reviewers