Check webservice using PS

How to check webservice available or not by using PS?

By using “Check if Webservice is available” step we can checks if a given URL (e.g. a Webservice URL) in the input stream is valid, can be
connected and if data can be read from it. If it connects within the given timeout and data can be read, it returns ‘true’, otherwise ‘false’.