I want to take the http status of multiple URL at once to prepare a report. How to acheive it using powershell?
相关问题
- How to Debug/Register a Permanent WMI Event Which
- How can I do variable substitution in a here-strin
- How to use a default value with parameter sets in
- Does powershell have a method_missing()?
- Invoking Mirth Connect CLI with Powershell script
I have seen questions on monitoring multiple websites through windows machine. My friend wanted to check status of 200 URLs which he used to do manually. I wrote a Power-Shell script to overcome this. Posting it for the benefit of all users.
Save the below code as "AnyName.ps1" file in "D:\MonitorWeb\"
Place a file "URLList.txt" with list of URLs in the same directory "D:\MonitorWeb\"
e.g:
Now open normal command prompt and navigate to the "D:\MonitorWeb\" and type below command:
powershell -executionpolicy bypass -File .\AnyName.ps1
And you'll get output like below:
HTTP STATUS 200 = OK
Note:
This works in power-shell version 2 as well.
Works even if you are behind proxy (uses default proxy settings)
Hope this helps!