class GraylogMessage { [string] $short_message; [string] $full_message }
$Uri = 'http://192.168.1.119:12201/gelf'
$Headers = @{'Content-Type' = 'application/json'; }
$Message = [GraylogMessage]::New()
$Message.short_message = 'Robocopy EMV VIX Pulse'
$Message.full_message = [IO.File]::ReadAllText('C:\logs\robocopylogs.txt')
Invoke-WebRequest -Uri $Uri -Method POST -Headers $Headers -Body (ConvertTo-Json $Message)
Malheureusement, il reste bloqué à la ligne invoke-webrequest.
Je complèterai quand j’aurai la réponse…
About the author