-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck-now.ps1
More file actions
31 lines (26 loc) · 1.38 KB
/
check-now.ps1
File metadata and controls
31 lines (26 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Add-Type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAll7 : ICertificatePolicy {
public bool CheckValidationResult(ServicePoint s, X509Certificate c, WebRequest r, int p) { return true; }
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAll7
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$h = @{ Authorization = 'Bearer 38154aafd6867378cb200f31661aa4ed524bb64aa8d91f6d1ad0d61fb8f695fa' }
$campaign = Invoke-RestMethod -Uri 'https://localhost:3333/api/campaigns/6' -Headers $h
Write-Host "=== Campaign: $($campaign.name) ===" -ForegroundColor Cyan
Write-Host "Status: $($campaign.status)" -ForegroundColor Yellow
Write-Host "Created: $($campaign.created_date)" -ForegroundColor Gray
Write-Host ""
foreach ($r in $campaign.results) {
Write-Host "Target: $($r.email)" -ForegroundColor White
Write-Host " Status: $($r.status)" -ForegroundColor $(if ($r.status -eq 'Email Sent') { 'Green' } elseif ($r.status -eq 'Clicked Link') { 'Yellow' } elseif ($r.status -eq 'Submitted Data') { 'Red' } else { 'Gray' })
Write-Host " First Name: $($r.first_name)"
Write-Host " IP: $($r.ip)"
Write-Host ""
}
Write-Host "=== Timeline ===" -ForegroundColor Cyan
foreach ($e in $campaign.timeline) {
Write-Host " [$($e.time)] $($e.email) - $($e.message)" -ForegroundColor Gray
}