centrum.ps1
$data = get-content -Path .\data.json -Raw | ConvertFrom-Json -Depth 100 foreach ($mailObj in $data ) { $eMail = "$($mailObj.name)@dyreklinikkencentrum.dk" if ($mailObj.mailAddressStatus -ne "ACTIVE") { Write-Host "$eMail - Deaktiveret" -ForegroundColor Red continue } Write-Host "$eMail" -NoNewline if ($mailObj.forwards -ne $null) { $forwards = $mailObj.forwards $fwdEmail = $forwards[0].address Write-Host " - Videresender til -> $fwdEmail" -ForegroundColor Yellow } else { Write-Host "" } } |