Guest User

Untitled

a guest
Jan 20th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. $header = @{
  2.  
  3. Host: "#########";
  4.  
  5. Authorization: "Basic ####################";
  6.  
  7. }
  8.  
  9.  
  10. $body = @{
  11.  
  12. sourceName = "Anything here";
  13.  
  14. sourceId = "Anything here ";
  15.  
  16. sourceIP = "##.##.##.###";
  17.  
  18. sourcePort = ####;
  19.  
  20. datetime = "###############";
  21.  
  22. payload = {
  23.  
  24. monitors = [
  25.  
  26. "REST response time",
  27.  
  28. "Authentication failures"
  29.  
  30. ]
  31. }
  32.  
  33. }
  34.  
  35. $Js = $body | ConvertTo-Json;
  36.  
  37. $response = Invoke-RestMethod -Method PUT -Headers $headers -Uri http://$ipAddr/reader/monitors -Body $Js;
Add Comment
Please, Sign In to add comment