Get-EmailPwnage.psm1

<#
 
.DESCRIPTION
 Gets Pwnage information from https://haveibeenpwned.com
 
#>
 
Param()
<#
.SYNOPSIS
Gets information on compromised email accounts
 
.DESCRIPTION
Check to see if your email account was involved in a data breach. Returns $False if the email address is not involved in any breach.
 
 
.Example
 
HaveIBeenPwned -Email myemailaddress@example.com
 
.INPUTS
Requires email address
 
.OUTPUTS
Results are returned as an array
 
.NOTES
Author: Tim Jardim
Date: 20.11.18 (dd.mm.yy)
 
Version:1.001.002
 
#>

Function HaveIBeenPwned ($Email)
    {
     Try
        {
         $HaveIBeenPwned=Invoke-WebRequest -Uri "https://haveibeenpwned.com/api/v2/breachedaccount/$Email" -ErrorAction Stop
        }
     Catch 
        {
         Return $false
        }
     $FinalResults=ConvertFrom-Json -InputObject $HaveIBeenPwned 
     Return $FinalResults
    }