Created
April 23, 2018 15:12
-
-
Save Graham-Beer/02c29fefc5e0653a7c6aed4ed4f9aa83 to your computer and use it in GitHub Desktop.
Little function to make use of 'Dinopass' api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter Get-DinoPW { | |
param ( | |
[Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] | |
[ValidateSet('Simple', 'Strong')] | |
$SetPwStrength | |
) | |
$uri = switch ($SetPwStrength) { | |
'Simple' { 'http://www.dinopass.com/password/simple' } | |
'Strong' { 'http://www.dinopass.com/password/strong' } | |
} | |
try { | |
Invoke-RestMethod -Uri $uri | |
} | |
catch { | |
Throw $_ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment