### Enter servername/ip and https port of idrac interface $server = "10.20.30.40:443" ### we need to send at least a header with 'accept' $header = @{'Accept'='application/json;*/*'} ### call the redfish interface for 100 times for ($i = 1; $i -lt 101; $i++) { Write-Host "call #$i" -ForegroundColor Cyan try { $redResponse = $null $redResponse = Invoke-WebRequest -Uri "https://$server/redfish/v1" -Method Get -Headers $header } catch [System.Net.WebException] { Write-Host "Exception message: $($Error[0].Exception.Message)" -ForegroundColor Magenta } catch [System.Exception] { Write-Host "Other exception $($Error[0].Exveption.Message)" -ForegroundColor Magenta } ### we only can get a http status code, if we get a valid response if ($redResponse -ne $null) { Write-Host "HTTP Status Code: $($redResponse.StatusCode)" } ### wait some time before executing the next call [System.Threading.Thread]::Sleep(250) #value in milliseconds }