I have a list of application web URLs, wherein I am trying to monitor HTTP statuscode of the web URL by Invoke-WebRequest command method.
I got the list objects by below command:
Invoke-WebRequest https://example.com/123 | Get-Member
Here, I am using statuscode and statusdescription fields to include it in output:
Invoke-WebRequest https://example.com/123 |
Select-Object StatusCode, StatusDescription |
ft -a
Now I wish to include a custom name of URL in output before statuscode and statusdescription so that output will look like below
URL StatusCode StatusDescription --- ---------- ----------------- abc web page 200 OK
Add-Memberis "adding custom parameter to the variable" for further usage, eg., if you dont need/want to store values, it can be pretty more easier, eg.