1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
gc ficheromails.txt | %{ $_ try{ #Con Invoke-WebRequest da error al cargar el certificado, mejor descargar el fichero JSON resultado Start-BitsTransfer "https://haveibeenpwned.com/api/breachedaccount/$_" -Destination resultado.txt "Cuenta comprometida" "La cuenta ha sido comprometida en: " gc .\resultado.txt | ConvertFrom-JSON } catch { if($_.Exception.Response.StatusCode.Value__ -eq 404) { "Cuenta no comprometida" } } } |